diff --git a/CHANGELOG.md b/CHANGELOG.md index 339d4b86741..43efa6ad00a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py index ddfc2e2c934..9599fbd976d 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py @@ -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,