On 04 May 09:38, Tristan Colgate wrote:
> Bringing the discussion from github to here to get more feedback.
> 
> https://github.com/prometheus/prometheus/issues/8763
> 
> At present the format used by count_values isn't specified in
> documentation. (It ends up using %f formatting). There are times when
> it is useful for count_values resulting label to be compatible with
> the labels produced for histogram "le" labels. (one such case is
> documented here,
> https://medium.com/@tristan_96324/prometheus-apdex-alerting-d17a065e39d0)
> 
> While in the provided example, it is possible to produce the "le"
> label for matching via other means), it would still be convenient to
> offer a method of controlling the format used by count_values.
> 
> In the github issue referenced about, it has been suggested that
> count_values arguments could be used to control the value format.
> We've suggested allowing a fmt.Printf style (actually
> strconv.FormatFloat), specification to be appended to the label name,
> perhaps via a comma. e.g.
> 
> count_values("le,g.2")

I would suggest using an optional argument instead:

count_values("le", "%.2f")

> 
> In addition, to support the bucket labels produced for OpenMetrics
> histograms, we could use 'o' to facilitate OpenMetrics compatible
> formatting (this is %g with s potential additional .0 appended to
> exact integer values). 'o' is unused by FormatFloat.
> 
> I'm willing to undertake the work, if people agree, but appreciate
> that the method of specifying a formatting here probably warrants
> wider discussion.
> -- 
> Tristan Colgate-McFarlane
> ----
>   "You can get all your daily vitamins from 52 pints of guiness, and a
> glass of milk"
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Prometheus Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/prometheus-developers/CAPGZSGKCw0-0Tp83i26M%2BJ70OLEF4W2dmMoX44zXOo2EoWypiA%40mail.gmail.com.

-- 
Julien Pivotto
@roidelapluie

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-developers/20210504143600.GA533764%40oxygen.

Reply via email to