open-telemetry/opentelemetry-dotnet

Disabling and later reenabling a metric stream does not reset the start time when using cumulative temporality

Open

#5,064 opened on Nov 18, 2023

View on GitHub
 (3 comments) (0 reactions) (0 assignees)C# (889 forks)auto 404
bughelp wantedkeep-open

Repository metrics

Stars
 (3,725 stars)
PR merge metrics
 (PR metrics pending)

Description

With #4958, it is now possible to disable and later reenable a metric stream. A number of bugs were identified while in the process of working on #4958. Some were fixed, but this one remains.

Disabling a measurement can be thought of as introducing an intentional gap in a metric stream. When using cumulative temporality the current aggregated value depends on all prior measurements. The start time and current timestamp mark an unbroken sequence of measurements for that time period. When measurements stop - i.e., by disabling a metric stream - and then are later reenabled, the start time must be reset to when the measurements began again. This is important so that backends can accurately identify gaps in a metric stream.

For reference, see the documentation in the proto definition

Contributor guide