-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sanitize metric names in the prometheus exporter (#3212)
* sanitize metric names in the prometheus exporter * add changelog entry * fix now invalid comment * replace sanitizeName algorithm with one based on strings.Map * check that digits as first characters are replaced * Update exporters/prometheus/exporter.go Co-authored-by: Tyler Yahn <[email protected]> * add missing utf8 import * add explicit tests for sanitizeName * fix testdata with digit prepend Co-authored-by: Tyler Yahn <[email protected]> Co-authored-by: Chester Cheung <[email protected]>
- Loading branch information
1 parent
2ae5922
commit bfaff3a
Showing
4 changed files
with
118 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# HELP bar a fun little gauge | ||
# TYPE bar counter | ||
bar{A="B",C="D"} 75 | ||
# HELP _0invalid_counter_name a counter with an invalid name | ||
# TYPE _0invalid_counter_name counter | ||
_0invalid_counter_name{A="B",C="D"} 100 | ||
# HELP invalid_gauge_name a gauge with an invalid name | ||
# TYPE invalid_gauge_name counter | ||
invalid_gauge_name{A="B",C="D"} 100 | ||
# HELP invalid_hist_name a histogram with an invalid name | ||
# TYPE invalid_hist_name histogram | ||
invalid_hist_name_bucket{A="B",C="D",le="0"} 0 | ||
invalid_hist_name_bucket{A="B",C="D",le="5"} 0 | ||
invalid_hist_name_bucket{A="B",C="D",le="10"} 0 | ||
invalid_hist_name_bucket{A="B",C="D",le="25"} 1 | ||
invalid_hist_name_bucket{A="B",C="D",le="50"} 0 | ||
invalid_hist_name_bucket{A="B",C="D",le="75"} 0 | ||
invalid_hist_name_bucket{A="B",C="D",le="100"} 0 | ||
invalid_hist_name_bucket{A="B",C="D",le="250"} 0 | ||
invalid_hist_name_bucket{A="B",C="D",le="500"} 0 | ||
invalid_hist_name_bucket{A="B",C="D",le="1000"} 0 | ||
invalid_hist_name_bucket{A="B",C="D",le="+Inf"} 1 | ||
invalid_hist_name_sum{A="B",C="D"} 23 | ||
invalid_hist_name_count{A="B",C="D"} 1 |