Open byjus-vaibhav opened 1 year ago
@byjus-vaibhav I don't know if this matches your use case, but the way to increment integers based on the previous value is to use cumulativeSum()
. I'm not familiar with a prometheus counter
function and there isn't one listed in the function documentation.
There is a section in the Flux documentation that specifically walks through using Flux to work with Prometheus metrics: https://docs.influxdata.com/flux/v0.x/prometheus/metric-types/
Counter is a metric or you can say a 'data-type' in prometheus which holds one value at time. It is meant to store the count of metrics that can only increase, for example - service requests, total hits on a page or an API. It only has one method increment which increments the value of the metric based on the previous value.
Is there a way I can update a metric's value in a threadsafe manner instead of making multiple entries and adding them everytime? Thanks!
Describe the issue here.
Relevant URLs