At startup, I'd like to send the count of outstanding operations a server process fetched from a DB. I think this should be a gauge value, since it's not really a counter, but in opentelemetry-js there is only an “observable gauge” with a callback, which will end up reporting foo.ops_at_startup: 87
for every metrics collection, which is completely unnecessary. Is there a way to only report a value once and then stop reporting this value?
How to send a one-off value using open-telemetry?
Asked Answered
Idk about opentelemetry-js, but in the python-sdk there is the unofficial possibility to set the metric reader interval to infinity, which leads to no signals being sent at all, and then manually call exporter.collect() - here's some hacky code I just wrote that shows how it works: github.com/datacontract/cli/compare/… –
Sequent
© 2022 - 2024 — McMap. All rights reserved.