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

feat(sdk-metrics-base): distinguish between Sum and Gauge in MetricData #3079

Merged

Conversation

pichlermarc
Copy link
Member

Which problem is this PR solving?

We do not distinguish between Sum and Gauge in MetricData. This complicates development of third-party exporters, which are required to rely on InstrumentType, which due to different Aggregations can be confusing and therefore error-prone.

This PR adds SumDataPoint and GaugeDataPoint as a replacement for SingularDataPoint, and includes isMonotonic in SumDataPoint, and updates exporters in this repo accordingly.

Fixes #3063

Short description of the changes

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • breaks existing metrics exporters due to removal of DataPointType.SINGULAR

How Has This Been Tested?

  • Existing tests (adapted)

Checklist:

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

@codecov
Copy link

codecov bot commented Jul 7, 2022

Codecov Report

Merging #3079 (ac7d6b5) into main (4ee8fe3) will increase coverage by 0.42%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #3079      +/-   ##
==========================================
+ Coverage   92.66%   93.08%   +0.42%     
==========================================
  Files         173      188      +15     
  Lines        5518     6248     +730     
  Branches     1171     1313     +142     
==========================================
+ Hits         5113     5816     +703     
- Misses        405      432      +27     
Impacted Files Coverage Δ
...ry-exporter-prometheus/src/PrometheusSerializer.ts 95.16% <100.00%> (+0.03%) ⬆️
...metry-sdk-metrics-base/src/aggregator/LastValue.ts 100.00% <100.00%> (ø)
...entelemetry-sdk-metrics-base/src/aggregator/Sum.ts 100.00% <100.00%> (ø)
...elemetry-sdk-metrics-base/src/export/MetricData.ts 100.00% <100.00%> (ø)
.../packages/otlp-transformer/src/metrics/internal.ts 97.72% <100.00%> (-0.43%) ⬇️
...telemetry-sdk-trace-web/src/StackContextManager.ts 94.28% <0.00%> (ø)
...-instrumentation-fetch/src/enums/AttributeNames.ts 100.00% <0.00%> (ø)
...-sdk-trace-web/src/enums/PerformanceTimingNames.ts 100.00% <0.00%> (ø)
...ry-context-zone-peer-dep/src/ZoneContextManager.ts 85.18% <0.00%> (ø)
...ckages/opentelemetry-sdk-trace-web/karma.worker.js 100.00% <0.00%> (ø)
... and 15 more

@pichlermarc pichlermarc force-pushed the add-monotonic-flag branch from 058910a to 09294f3 Compare July 7, 2022 11:28
@pichlermarc pichlermarc marked this pull request as ready for review July 7, 2022 14:18
@pichlermarc pichlermarc requested a review from a team July 7, 2022 14:18
Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

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

This is a great change! Overall LGTM. Just a few suggestions on testing.

@pichlermarc pichlermarc force-pushed the add-monotonic-flag branch from f923764 to 1a442db Compare July 8, 2022 15:26
@legendecas legendecas merged commit 9ac9976 into open-telemetry:main Jul 19, 2022
@pichlermarc pichlermarc deleted the add-monotonic-flag branch July 20, 2022 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exporting isMonotonic flag to exporters
3 participants