-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[prometheusremotewrite] fix: counter name check (#2613)
* [prometheusremotewrite] fix: counter name check fixes #2608 Ensure that the metric name is greater than the length of the counter suffix ("_total") before checking if it contains the counter suffix to prevent crashes for short (smaller or eq to the length of the suffix) metric names. The edge case where the metric name is "_total" is not handled (considered not to have the suffix), but should not occur IRL. Also fix the spelling of "delimiter". Signed-off-by: naseemkullah <naseem@transit.app> * use strings.HasSuffix() Signed-off-by: naseemkullah <naseem@transit.app> * add already suffixed counter test Signed-off-by: naseemkullah <naseem@transit.app>
- Loading branch information
Naseem
authored
Mar 8, 2021
1 parent
65c4c4a
commit 35cf41e
Showing
3 changed files
with
34 additions
and
19 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