diff --git a/opentelemetry-api/CHANGELOG.md b/opentelemetry-api/CHANGELOG.md index 6f1d2b4f8e6..3f4ed4f0298 100644 --- a/opentelemetry-api/CHANGELOG.md +++ b/opentelemetry-api/CHANGELOG.md @@ -11,7 +11,8 @@ Released 2020-11-02 ## Version 0.14b0 Released 2020-10-13 - +- Add optional parameter to `record_exception` method + ([#1242](https://github.com/open-telemetry/opentelemetry-python/pull/1242)) - Add support for `OTEL_PROPAGATORS` ([#1123](https://github.com/open-telemetry/opentelemetry-python/pull/1123)) - Store `int`s as `int`s in the global Configuration object diff --git a/opentelemetry-api/src/opentelemetry/trace/span.py b/opentelemetry-api/src/opentelemetry/trace/span.py index 2b206468afa..5cf4c36a3e8 100644 --- a/opentelemetry-api/src/opentelemetry/trace/span.py +++ b/opentelemetry-api/src/opentelemetry/trace/span.py @@ -79,7 +79,12 @@ def set_status(self, status: Status) -> None: """ @abc.abstractmethod - def record_exception(self, exception: Exception) -> None: + def record_exception( + self, + exception: Exception, + attributes: types.Attributes = None, + timestamp: typing.Optional[int] = None, + ) -> None: """Records an exception as a span event.""" def __enter__(self) -> "Span": @@ -263,7 +268,12 @@ def update_name(self, name: str) -> None: def set_status(self, status: Status) -> None: pass - def record_exception(self, exception: Exception) -> None: + def record_exception( + self, + exception: Exception, + attributes: types.Attributes = None, + timestamp: typing.Optional[int] = None, + ) -> None: pass diff --git a/opentelemetry-sdk/CHANGELOG.md b/opentelemetry-sdk/CHANGELOG.md index 2d12e54d98d..fc635bc2392 100644 --- a/opentelemetry-sdk/CHANGELOG.md +++ b/opentelemetry-sdk/CHANGELOG.md @@ -28,7 +28,8 @@ Released 2020-11-02 ## Version 0.14b0 Released 2020-10-13 - +- Add optional parameter to `record_exception` method + ([#1242](https://github.com/open-telemetry/opentelemetry-python/pull/1242)) - Add timestamps to aggregators ([#1199](https://github.com/open-telemetry/opentelemetry-python/pull/1199)) - Add Global Error Handler diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py index c0189e807e7..ab90c9316cd 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py @@ -680,7 +680,12 @@ def __exit__( super().__exit__(exc_type, exc_val, exc_tb) - def record_exception(self, exception: Exception) -> None: + def record_exception( + self, + exception: Exception, + attributes: types.Attributes = None, + timestamp: Optional[int] = None, + ) -> None: """Records an exception as a span event.""" try: stacktrace = traceback.format_exc()