Update gRPCContext wrapper class (#420)

There are a few cases where one needs to dig into `grpc.ServicerContext`
objects, and these fields were missing from our wrapper, which can cause
issues with implmementation.
This commit is contained in:
Michael Stella
2021-04-13 18:22:43 -04:00
committed by GitHub
parent 658f9ca019
commit e7d26a4c2d
2 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#387](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/387))
- Update redis instrumentation to follow semantic conventions
([#403](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/403))
- Update gRPC instrumentation to better wrap server context
([#420](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/420))
### Added
- `opentelemetry-instrumentation-urllib3` Add urllib3 instrumentation

View File

@ -71,6 +71,9 @@ class _OpenTelemetryServicerContext(grpc.ServicerContext):
self.details = None
super().__init__()
def __getattr__(self, attr):
return getattr(self._servicer_context, attr)
def is_active(self, *args, **kwargs):
return self._servicer_context.is_active(*args, **kwargs)