Commit bc16164
committed
fix(cmetrics): prevent appending .0 to scientific notation in bucket_value_to_string
`bucket_value_to_string` used %g to format histogram bucket boundaries,
which switches to scientific notation for values >= 1e6. The subsequent
check for a missing decimal point would then append ".0", producing
malformed labels like "1e+06.0" that Prometheus rejects with:
```
bucket label "le" is missing or has a malformed value of "1e+08.0"
```
Skip the ".0" suffix when the string already contains 'e', since
scientific notation is valid in Prometheus `le` labels without it.
Fixes #11651
Signed-off-by: Luis Pigueiras <luis.pigueiras@cern.ch>1 parent 32a3cbb commit bc16164
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
377 | 381 | | |
378 | 382 | | |
379 | 383 | | |
| |||
0 commit comments