Request: Support for Synchronous Gauge #2771
Labels
duplicate
This issue or pull request already exists
spec:metrics
Related to the specification/metrics directory
What are you trying to achieve?
I'll start from an example.
Let's say there is a scheduled job which retrieves some data from DB, runs some business calculations and performs some set of actions. At the end of such job, some data is collected (i.e. amount of processed and unprocessed items due to business errors).
I'd like to have that data (i.e. amount of unprocessed items) displayed in my monitoring tool, however with the current otel implementation/specification I can not easily collect such metric.
Gauge looks like the best tool for such job, but the problem here is that it's asynchronous and works by sampling. Since the amount of unprocessable items is only known/calculated at the end of job, my value can't easily be sampled asynchronously.
Looks like the best approach would be to update such metric at the end of the job. (Sync gauge which updates the value whenever needed)
I'm pretty sure there should be some other situations where synchronous gauge would be preferred over asynchronous one.
Let me know if this doesn't make any sense.
Additional context.
Somebody else has also asked for such feature support in opentelemetry-js repository and his use case is explained there - open-telemetry/opentelemetry-js#3103
The text was updated successfully, but these errors were encountered: