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

Adds a note about not splitting UpDownCounter timeseries #3367

Merged
merged 10 commits into from
Apr 18, 2023
10 changes: 10 additions & 0 deletions specification/metrics/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ linkTitle: Semantic Conventions
* [Instrument Naming](#instrument-naming)
* [Instrument Units](#instrument-units)
* [Instrument Types](#instrument-types)
* [Consistent UpDownCounter timeseries](#consistent-updowncounter-timeseries)

<!-- tocstop -->

Expand Down Expand Up @@ -205,3 +206,12 @@ like `Counter` or `UpDownCounter`. However, compliant implementations MAY use th
like `Asynchronous Counter` or `Asynchronous UpDownCounter`.
Whether implementations choose the synchronous type or the asynchronous equivalent is considered to be an
implementation detail. Both choices are compliant with this specification.

### Consistent UpDownCounter timeseries

When recording `UpDownCounter` metrics, the same attribute values used to record an increment SHOULD be used to record
any associated decrement, otherwise those increments and decrements will end up as different timeseries.

For example, if you are tracking `active_requests` with an `UpDownCounter`, and you are incrementing it each time a
request starts and decrementing it each time a request ends, then any attributes which are not yet available when
incrementing the counter at request start should not be used when decrementing the counter at request end.
reyang marked this conversation as resolved.
Show resolved Hide resolved