prometheus/util/strutil
Nick Moore 758914e1fb
Fix SanitizeLabelName for certain invalid labels
SanitizeLabelName was not correctly sanitizing label names that:

1. Started with a digit (0-9)
2. Were empty

This commit changes the santization code to catch both of these edge
cases and adds new tests to validate it works correctly in them both. In
the first case, a leading digit will be replaced with an underscore, and
in the latter, the function will return a single underscore.

Signed-off-by: Nick Moore <nicholas.moore@grafana.com>
2023-02-03 08:53:10 +00:00
..
quote.go Update go to 1.19, set min version to 1.18 (#11279) 2022-09-07 11:30:48 +02:00
quote_test.go Add license notice for code adapted from Go 2021-12-05 09:01:52 +01:00
strconv.go Fix SanitizeLabelName for certain invalid labels 2023-02-03 08:53:10 +00:00
strconv_test.go Fix SanitizeLabelName for certain invalid labels 2023-02-03 08:53:10 +00:00