Skip to main content

Module go_format

Module go_format 

Source
Expand description

The shortest float formats of Goโ€™s strconv, which Prometheus writes label values in.

Functionsยง

format_float_f ๐Ÿ”’
Goโ€™s strconv.FormatFloat(value, 'f', -1, 64), the form of count_values labels.
format_float_g ๐Ÿ”’
Goโ€™s strconv.FormatFloat(value, 'g', -1, 64), which %g and %v print a float in: the shortest digits, with an exponent of at least two digits below 1e-4 and from 1e6 on.
format_open_metrics_float ๐Ÿ”’
Prometheus labels.FormatOpenMetricsFloat, the form of histogram_quantiles labels: Goโ€™s shortest 'g' format, with .0 appended to an integer and 0, 1 and -1 written as 0.0, 1.0 and -1.0.
positional ๐Ÿ”’
ยฑ0.digits ร— 10^point in positional notation without trailing fractional zeros.
shortest ๐Ÿ”’
The fewest significant digits of a finite value that round-trip, without trailing zeros, and the position of the decimal point among them: value = ยฑ0.digits ร— 10^point. Zero is "0" at point 1.
special ๐Ÿ”’