Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a9a96aa

Browse files
author
Alex Boten
authored
bugfix: indent not used in MetricsData to_json (open-telemetry#3197)
1 parent 69de3dc commit a9a96aa

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## Unreleased
99
- PeriodicExportingMetricReader will continue if collection times out
1010
([#3100](https://github.com/open-telemetry/opentelemetry-python/pull/3100))
11-
11+
- Fix formatting of ConsoleMetricExporter.
12+
([#3197](https://github.com/open-telemetry/opentelemetry-python/pull/3197))
1213

1314
## Version 1.16.0/0.37b0 (2023-02-17)
1415
- Change ``__all__`` to be statically defined.

opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/point.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,5 +211,6 @@ def to_json(self, indent=4) -> str:
211211
loads(resource_metrics.to_json(indent=indent))
212212
for resource_metrics in self.resource_metrics
213213
]
214-
}
214+
},
215+
indent=indent,
215216
)

opentelemetry-sdk/tests/metrics/integration_test/test_console_exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_console_exporter(self):
4949
provider.shutdown()
5050

5151
output.seek(0)
52-
result_0 = loads(output.readlines()[0])
52+
result_0 = loads("".join(output.readlines()))
5353

5454
self.assertGreater(len(result_0), 0)
5555

0 commit comments

Comments
 (0)