opentelemetry-erlang icon indicating copy to clipboard operation
opentelemetry-erlang copied to clipboard

Metrics: remove active instruments that haven't had recent recordings

Open tsloughter opened this issue 4 years ago • 1 comments

Each active instrument (the combination of an instrument name and a labelset) is stored in the active instruments ets table. There is no reason to keep these active instrument rows if they are not actively being used.

The active_instrument needs to change to include a counter for how many collection cycles this record has not had an update. After a certain threshold the row is removed from the table.

This is detailed in the SDK spec https://github.com/open-telemetry/opentelemetry-specification/blob/2b75442b05fd968f197422dc18124338a955f3a2/specification/sdk-metric.md#recommended-implementation

tsloughter avatar Mar 13 '20 23:03 tsloughter

Additional context about active instruments and collection cycles https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/metrics/sdk.md#accumulator-collect-function

tsloughter avatar Nov 28 '20 14:11 tsloughter