Skip to content

Commit

Permalink
Fix test and add changelog entry for open-telemetry#3536
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewins committed Nov 22, 2023
1 parent 6c796b6 commit 8d8b107
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]})

Expand All @@ -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,
)
Expand Down

0 comments on commit 8d8b107

Please sign in to comment.