diff --git a/CHANGELOG.md b/CHANGELOG.md index fa1ad66ccf7..9cc24ba9dc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- Log stacktrace on `UNKNOWN` status OTLP export error + ([#3536](https://github.com/open-telemetry/opentelemetry-python/pull/3536)) - Fix OTLPExporterMixin shutdown timeout period ([#3524](https://github.com/open-telemetry/opentelemetry-python/pull/3524)) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_metrics_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_metrics_exporter.py index db2a6a00156..291e9457efd 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_metrics_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_metrics_exporter.py @@ -453,8 +453,8 @@ def test_unavailable_delay(self, mock_sleep, mock_expo): "opentelemetry.exporter.otlp.proto.grpc.exporter._create_exp_backoff_generator" ) @patch("opentelemetry.exporter.otlp.proto.grpc.exporter.sleep") - @patch("opentelemetry.exporter.otlp.proto.grpc.exporter.logger") - def test_unknown_logs(self, mock_sleep, mock_expo, mock_logger): + @patch("opentelemetry.exporter.otlp.proto.grpc.exporter.logger.error") + def test_unknown_logs(self, mock_logger_error, mock_sleep, mock_expo): mock_expo.configure_mock(**{"return_value": [1]}) @@ -465,11 +465,11 @@ def test_unknown_logs(self, mock_sleep, mock_expo, mock_logger): self.exporter.export(self.metrics["sum_int"]), MetricExportResult.FAILURE, ) - mock_sleep.assert_called_with(1) - mock_logger.error.assert_called_with( + mock_sleep.assert_not_called() + mock_logger_error.assert_called_with( "Failed to export %s to %s, error code: %s", "metrics", - "TODO", + "localhost:4317", StatusCode.UNKNOWN, exc_info=True, )