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

Test metric aggregate start time complies with specification #5312

Closed
MrAlias opened this issue May 7, 2024 · 0 comments · Fixed by #5323
Closed

Test metric aggregate start time complies with specification #5312

MrAlias opened this issue May 7, 2024 · 0 comments · Fixed by #5323
Assignees
Labels
area:metrics Part of OpenTelemetry Metrics pkg:SDK Related to an SDK package pkg:testing Related to testing or a testing package
Milestone

Comments

@MrAlias
Copy link
Contributor

MrAlias commented May 7, 2024

The specification was updated here to have different start-time behavior for delta vs cumulative temporality for both synchronous and asynchronous instruments. Specifically:

The MetricReader selection of temporality as a function of instrument kind influences the starting timestamp (i.e. StartTimeUnixNano) of metrics data points received by MetricReader.Collect. For instruments with Cumulative aggregation temporality, successive data points received by successive calls to MetricReader.Collect MUST repeat the same starting timestamps (e.g. (T0, T1], (T0, T2], (T0, T3]). For instruments with Delta aggregation temporality, successive data points received by successive calls to MetricReader.Collect MUST advance the starting timestamp ( e.g. (T0, T1], (T1, T2], (T2, T3]). The ending timestamp (i.e. TimeUnixNano) MUST always be equal to time the metric data point took effect, which is equal to when MetricReader.Collect was invoked. These rules apply to all metrics, not just those whose point kinds includes an aggregation temporality field. See data model temporality for more details.

Our current testing only checks the presence of the start time. It does not test the correct cycling.

Test should be added to verify this and prevent regressions.

@MrAlias MrAlias added pkg:testing Related to testing or a testing package pkg:SDK Related to an SDK package area:metrics Part of OpenTelemetry Metrics labels May 7, 2024
@MrAlias MrAlias added this to the v1.27.0 milestone May 7, 2024
@MrAlias MrAlias self-assigned this May 7, 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 pkg:SDK Related to an SDK package pkg:testing Related to testing or a testing package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant