Skip to content

Commit e7d26a4

Browse files
authored
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.
1 parent 658f9ca commit e7d26a4

File tree

2 files changed

+5
-0
lines changed
  • instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc

2 files changed

+5
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
([#387](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/387))
1616
- Update redis instrumentation to follow semantic conventions
1717
([#403](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/403))
18+
- Update gRPC instrumentation to better wrap server context
19+
([#420](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/420))
1820

1921
### Added
2022
- `opentelemetry-instrumentation-urllib3` Add urllib3 instrumentation

instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py

+3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def __init__(self, servicer_context, active_span):
7171
self.details = None
7272
super().__init__()
7373

74+
def __getattr__(self, attr):
75+
return getattr(self._servicer_context, attr)
76+
7477
def is_active(self, *args, **kwargs):
7578
return self._servicer_context.is_active(*args, **kwargs)
7679

0 commit comments

Comments
 (0)