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

Do not export aggregations without any data points #3436

Merged
merged 13 commits into from
Nov 11, 2022

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Nov 2, 2022

Fix #3394

Currently, the SDK exports histograms, last-values, and sums that do not contain any data points. This updates the aggregation implementations to return nil instead of values if that is the case. From there this will prevent empty data from being exported:

data := inst.aggregator.Aggregation()
if data != nil {

@MrAlias MrAlias added pkg:SDK Related to an SDK package area:metrics Part of OpenTelemetry Metrics labels Nov 2, 2022
@MrAlias MrAlias added this to the Metric v0.34.0 milestone Nov 2, 2022
@codecov
Copy link

codecov bot commented Nov 2, 2022

Codecov Report

Merging #3436 (c1d41bd) into main (acd8777) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #3436   +/-   ##
=====================================
  Coverage   77.7%   77.7%           
=====================================
  Files        164     164           
  Lines      11520   11521    +1     
=====================================
+ Hits        8952    8957    +5     
+ Misses      2370    2368    -2     
+ Partials     198     196    -2     
Impacted Files Coverage Δ
sdk/metric/internal/histogram.go 100.0% <100.0%> (+2.1%) ⬆️
sdk/metric/internal/lastvalue.go 100.0% <100.0%> (ø)
sdk/metric/internal/sum.go 100.0% <100.0%> (+2.4%) ⬆️
exporters/jaeger/jaeger.go 90.3% <0.0%> (-0.9%) ⬇️

@MrAlias MrAlias merged commit d091ba8 into open-telemetry:main Nov 11, 2022
@MrAlias MrAlias deleted the nil-empty-aggs branch November 11, 2022 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics pkg:SDK Related to an SDK package
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Exporter version 0.32.0 and higher is not compatible with opentelemetry-collector-contrib
4 participants