Skip to content

stats: add UpDownCounter #41785

@kyessenov

Description

@kyessenov

Currently, there is only a monotonic Counter and an absolute Gauge. OTLP defined a new instrument called UpDownCounter which is a Counter with sum aggregation but supports decrementing. The nice benefit of this is that it supports DELTA aggregation so Envoy doesn't need to store the absolute value indefinitely unlike Gauge.

In technical terms, the work is simply to add dec() operation to a Counter. It is essentially a subset of Counters so existing sinks should work as-is, as long as the sinks can handle non-monotonic counters.

This would work nicely with custom metrics since it can do +1 for log start and -1 for log end.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions