opentelemetry-python-contrib icon indicating copy to clipboard operation
opentelemetry-python-contrib copied to clipboard

Conformity of client intereptor(s) with the official `grpc.*ClientInterceptor`-interfaces

Open CoLa5 opened this issue 2 years ago • 4 comments
trafficstars

Description

Currently, the OpenTelemetryClientInterceptor is based on an external implementation of grpc client interceptors whose source code lies in the package grpcext.

To support the official grpc.UnaryUnaryClientInterceptor-, grpc.UnaryStreamClientInterceptor-, grpc.StreamUnaryClientInterceptor-, and grpc.StreamStreamClientInterceptor-interface, which are supported officially in grpc since v1.8.0, the source code of the _client.py-module is adapted.

Hereby, the design of the _client.py-module orientates itself strongly on the design of the _aio_client.py-module. Thus, the external implementation of the grpc client interceptors can be removed (package grpcext). Also, the RpcInfo-class in the utilities.py-module is not required any more.

The _aio_client.py-module must be adapted so that the _BaseAioClientInterceptor becomes independent of the _BaseClientInterceptor.

The test_client_interceptor_trace_context_propagation-tests are adapted according to the same test in the test_aio_client_interceptor.py-module to remove the dependency on the external implementation of the grpc client interceptors, which are located in the package grpcext.

The documentation of the code in the __init__.py is adapted accordingly.

Type of change

Please delete options that are not relevant.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [x] This change requires a documentation update

How Has This Been Tested?

  • [x] Run successfully tox -e test-instrumentation-grpc.

Does This PR Require a Core Repo Change?

  • [ ] Yes. - Link to PR:
  • [x] No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • [x] Followed the style guidelines of this project
  • [x] Changelogs have been updated
  • [ ] Unit tests have been added
  • [x] Documentation has been updated

CoLa5 avatar Jan 15 '23 20:01 CoLa5