Add a way to record multiple observations to a histogram, all having the same value, in a single method call #1818
                  
                    
                      vpranckaitis
                    
                  
                
                  started this conversation in
                Ideas
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, histogram metric interface only allows to record a single observation at a time, using
Observe(v float64)method. However, in some cases it might be useful to register multiple identical observations at once, using a single method call, e.g.ObserveMany(v float64, n int). While you could achieve the same thing by runningObserve()in a loop, that wouldn't scale for bigger values ofn.Concrete example of a case where this would be useful: on each query, I would like to record its time range duration to a histogram. However, I would also like to weight those observations by the number of items returned in the query response. I could potentially do that with
ObserveMany(timeRangeDuration, numberOfItems), but alas, current API doesn't allow to do that.If this seems like a feature that could be accepted, I could create a PR for it.
Beta Was this translation helpful? Give feedback.
All reactions