Skip to content

Conversation

@JacksonWeber
Copy link
Contributor

@JacksonWeber JacksonWeber commented Mar 3, 2024

Which problem is this PR solving?

Changed the depth of which the ConsoleMetricExporter will log such that values on metrics like attributes, startTime, endTime, and value will be logged entirely.

Example:
image

Fixes #4061

Short description of the changes

Change the console.dir depth to null to ensure objects part of the output metrics are fully serialized in the console.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Create a sample application that logs metrics to the console using the ConsoleMetricExporter. Observe the output metrics for correctness.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@JacksonWeber JacksonWeber requested a review from a team March 3, 2024 07:13
@codecov
Copy link

codecov bot commented Mar 3, 2024

Codecov Report

Merging #4522 (467e766) into main (3920b15) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4522   +/-   ##
=======================================
  Coverage   92.40%   92.40%           
=======================================
  Files         330      330           
  Lines        9531     9531           
  Branches     2036     2036           
=======================================
  Hits         8807     8807           
  Misses        724      724           
Files Coverage Δ
...es/sdk-metrics/src/export/ConsoleMetricExporter.ts 83.33% <100.00%> (ø)

... and 2 files with indirect coverage changes

@pichlermarc pichlermarc added bug Something isn't working priority:p4 Bugs and spec inconsistencies which do not fall into a higher prioritization labels Mar 4, 2024
@JacksonWeber JacksonWeber requested a review from pichlermarc March 4, 2024 17:08
Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this 👍

@pichlermarc pichlermarc merged commit 75bd723 into open-telemetry:main Mar 6, 2024
Zirak pushed a commit to Zirak/opentelemetry-js that referenced this pull request Sep 14, 2024
…y#4522)

* fix: (ConsoleMetricExporter): Increase console log depth to get useful information from metrics.

* update: add contribution to changelog.

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority:p4 Bugs and spec inconsistencies which do not fall into a higher prioritization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConsoleMetricExporter only outputs shallowly

2 participants