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

sdk/metric: Set StartTime for gauge metric points #4345

Closed
wants to merge 4 commits into from

Conversation

pellared
Copy link
Member

@pellared pellared commented Jul 20, 2023

Fixes #4269

Remarks

We may postpone until open-telemetry/opentelemetry-specification#3540 (or open-telemetry/opentelemetry-specification#3576) clarifies StartTimeUnixNano.

On the other hand, I am not sure when it happens. During the spec spec SIG meeting it looks that there is no common agreement what the value should be. However, people see that it is worth to set it as a "non-zero" value. I decided it may be worth to make a baby step. This is why I decided propose this PR. Especially that I think it is inline with the current recommendation:

(optional) A timestamp (start_time_unix_nano) which best represents the first possible moment a measurement could be recorded. This is commonly set to the timestamp when a metric collection system started.

@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #4345 (da73fc9) into main (e08359f) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #4345   +/-   ##
=====================================
  Coverage   83.4%   83.4%           
=====================================
  Files        185     185           
  Lines      14332   14338    +6     
=====================================
+ Hits       11958   11966    +8     
+ Misses      2147    2145    -2     
  Partials     227     227           
Impacted Files Coverage Δ
sdk/metric/internal/aggregate/aggregate.go 100.0% <100.0%> (ø)
sdk/metric/internal/aggregate/lastvalue.go 100.0% <100.0%> (ø)
sdk/metric/pipeline.go 91.2% <100.0%> (+<0.1%) ⬆️

... and 1 file with indirect coverage changes

@pellared pellared marked this pull request as ready for review July 20, 2023 11:54
@pellared pellared added area:metrics Part of OpenTelemetry Metrics pkg:SDK Related to an SDK package labels Jul 20, 2023
@pellared pellared self-assigned this Jul 20, 2023
@pellared
Copy link
Member Author

Closing per #4269 (comment)

@pellared pellared closed this Jul 21, 2023
@pellared pellared deleted the pellared/issue4269 branch November 17, 2023 09:00
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
None yet
Development

Successfully merging this pull request may close these issues.

sdk/metric: Set StartTime for gauge metric points
1 participant