Skip to content

Conversation

@lalitb
Copy link
Member

@lalitb lalitb commented Oct 4, 2022

Fixes #1588

Changes

While #1641 fixes the observable instrument metrics generation in general, the gauge instrument was broken separately. This PR fixes the metrics generation for gauge instrument by

  • ensuring sampling timestamp is correctly updated during aggregation.
  • ensuring the correct aggregation type ( double or long) is returned during merge/diff

Test cases are added.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@lalitb lalitb requested a review from a team October 4, 2022 00:23
@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Merging #1651 (6b480ee) into main (a64ac09) will increase coverage by 0.54%.
The diff coverage is 33.34%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1651      +/-   ##
==========================================
+ Coverage   84.35%   84.88%   +0.54%     
==========================================
  Files         170      170              
  Lines        5130     5132       +2     
==========================================
+ Hits         4327     4356      +29     
+ Misses        803      776      -27     
Impacted Files Coverage Δ
...k/src/metrics/aggregation/lastvalue_aggregation.cc 66.67% <33.34%> (+29.17%) ⬆️
sdk/src/trace/batch_span_processor.cc 90.63% <0.00%> (-0.78%) ⬇️
...etry/sdk/metrics/aggregation/default_aggregation.h 76.37% <0.00%> (+18.19%) ⬆️

Copy link
Member

@esigo esigo left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks for the fix :)

@esigo esigo enabled auto-merge (squash) October 6, 2022 16:31
@esigo esigo merged commit 79a9471 into open-telemetry:main Oct 6, 2022
yxue pushed a commit to yxue/opentelemetry-cpp that referenced this pull request Dec 5, 2022
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.

Observable Gauge does not reflect updated values, and send the old value always

2 participants