Skip to content

Commit

Permalink
Implement missing context methods
Browse files Browse the repository at this point in the history
Fixes #321
  • Loading branch information
ocelotl committed Mar 3, 2021
1 parent 7980997 commit 197165e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/open-telemetry/opentelemetry-python-contrib/compare/v0.18b0...HEAD)

- Implement context methods for `_InterceptorChannel`
([#363](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/363))

### Changed
- Rename `IdsGenerator` to `IdGenerator`
([#350](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/350))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from opentelemetry import trace
from opentelemetry.context import attach, detach
from opentelemetry.propagate import extract
from opentelemetry.trace.propagation.textmap import DictGetter
from opentelemetry.propagators.textmap import DictGetter
from opentelemetry.trace.status import Status, StatusCode

logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ def close(self):

def __enter__(self):
"""Enters the runtime context related to the channel object."""
raise NotImplementedError()
return self

def __exit__(self, exc_type, exc_val, exc_tb):
"""Exits the runtime context related to the channel object."""
raise NotImplementedError()
self.close()


def intercept_channel(channel, *interceptors):
Expand Down

0 comments on commit 197165e

Please sign in to comment.