Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ConsoleMetricExporter Should Not Export Shallowly #4522

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/

### :bug: (Bug Fix)

* fix(sdk-metrics): increase the depth of the output to the console such that objects in the metric are printed fully to the console [#4522](https://github.com/open-telemetry/opentelemetry-js/pull/4522) @JacksonWeber

### :books: (Refine Doc)

### :house: (Internal)
Expand Down
13 changes: 8 additions & 5 deletions packages/sdk-metrics/src/export/ConsoleMetricExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ export class ConsoleMetricExporter implements PushMetricExporter {
): void {
for (const scopeMetrics of metrics.scopeMetrics) {
for (const metric of scopeMetrics.metrics) {
console.dir({
descriptor: metric.descriptor,
dataPointType: metric.dataPointType,
dataPoints: metric.dataPoints,
});
console.dir(
{
descriptor: metric.descriptor,
dataPointType: metric.dataPointType,
dataPoints: metric.dataPoints,
},
{ depth: null }
);
}
}

Expand Down