Skip to content

Commit

Permalink
Make TracerProvider's resource private (#1652)
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanthccv authored Mar 1, 2021
1 parent e503ef3 commit 0c654f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Rename `IdsGenerator` to `IdGenerator`
([#1651])(https://github.com/open-telemetry/opentelemetry-python/pull/1651)
- Make TracerProvider's resource attribute private
([#1652])(https://github.com/open-telemetry/opentelemetry-python/pull/1652)
- Rename Resource's `create_empty` to `get_empty`
([#1653])(https://github.com/open-telemetry/opentelemetry-python/pull/1653)

Expand Down
6 changes: 5 additions & 1 deletion opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,12 +1009,16 @@ def __init__(
self.id_generator = RandomIdGenerator()
else:
self.id_generator = id_generator
self.resource = resource
self._resource = resource
self.sampler = sampler
self._atexit_handler = None
if shutdown_on_exit:
self._atexit_handler = atexit.register(self.shutdown)

@property
def resource(self) -> Resource:
return self._resource

def get_tracer(
self,
instrumenting_module_name: str,
Expand Down

0 comments on commit 0c654f2

Please sign in to comment.