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 #4269

Open
pellared opened this issue Jun 29, 2023 · 5 comments
Open

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

pellared opened this issue Jun 29, 2023 · 5 comments
Labels
area:metrics Part of OpenTelemetry Metrics enhancement New feature or request pkg:SDK Related to an SDK package

Comments

@pellared
Copy link
Member

pellared commented Jun 29, 2023

Problem Statement

From specification: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#gauge

(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.

Proposed Solution

I am not sure what "metric collection system started" exactly means.

We could capture time.Now() when either:

  • meter provider is created
  • instrument is created
  • first collect occurs
  • startup with an init function

Additional Context

Found it missing when debugging #4268

@MrAlias
Copy link
Contributor

MrAlias commented Jun 29, 2023

It could also mean we get the current time on startup with an init function.

Not sure what the appropriate timestamp is though.

@pellared
Copy link
Member Author

I created open-telemetry/opentelemetry-specification#3576

@pellared
Copy link
Member Author

I think right now we can set it to the time when metric provider is created until it is better specified.

@MrAlias
Copy link
Contributor

MrAlias commented Jul 20, 2023

This apears to not need a fix for the SDK GA. Can we remove it from the project?

It might also make sense to hold off on a solution until there is consensus in the spec so we don't have revert things.

@pellared
Copy link
Member Author

This apears to not need a fix for the SDK GA. Can we remove it from the project?

It might also make sense to hold off on a solution until there is consensus in the spec so we don't have revert things.

Moved to Go: Metric SDK (Post-GA)

@pellared pellared assigned pellared and unassigned pellared Jul 20, 2023
@MrAlias MrAlias moved this from Needs Triage to TODO in Go: Metric SDK (Post-GA) Jan 25, 2024
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 enhancement New feature or request pkg:SDK Related to an SDK package
Projects
Development

Successfully merging a pull request may close this issue.

2 participants