diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d4a7add3c6..a3dce1ed8e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#3776](https://github.com/open-telemetry/opentelemetry-python/pull/3776)) - Add support for OTEL_SDK_DISABLED environment variable ([#3648](https://github.com/open-telemetry/opentelemetry-python/pull/3648)) +- Don't exit ticker thread on collection failure + ([#3788](https://github.com/open-telemetry/opentelemetry-python/pull/3788)) - Fix ValueError message for PeriodicExportingMetricsReader ([#3769](https://github.com/open-telemetry/opentelemetry-python/pull/3769)) - Make span.record_exception more robust diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/export/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/export/__init__.py index 14546636a94..520bdb755eb 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/export/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/export/__init__.py @@ -518,6 +518,10 @@ def _ticker(self) -> None: interval_secs, exc_info=True, ) + except Exception as e: # pylint: disable=broad-except,invalid-name + _logger.exception( + "Exception while collecting metrics %s", str(e) + ) # one last collection below before shutting down completely self.collect(timeout_millis=self._export_interval_millis)