Relax metric name validation in Dropwizard5 CustomMappingSampleBuilder#1985
Open
LiamClarkeNZ wants to merge 1 commit intoprometheus:mainfrom
Open
Relax metric name validation in Dropwizard5 CustomMappingSampleBuilder#1985LiamClarkeNZ wants to merge 1 commit intoprometheus:mainfrom
LiamClarkeNZ wants to merge 1 commit intoprometheus:mainfrom
Conversation
The MapperConfig and GraphiteNamePattern classes enforced Graphite-style dot-separated naming conventions on input metrics, preventing the CustomMappingSampleBuilder from remapping metrics with underscores, colons, or single-level names. Relaxes the validation regex to accept a broader range of metric name patterns while still rejecting clearly invalid inputs. Fixes prometheus#461, prometheus#518, prometheus#645 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Liam Clarke-Hutchinson <liam@steelsky.co.nz>
0c81193 to
6746915
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decided to revisit a very old PR of mine that addressed an issue that seems to reoccur periodically for others.
Changes
METRIC_GLOB_REGEXinMapperConfig/GraphiteNamePatternto accept a broader range of metric name patternsCustomMappingSampleBuildercan now remap metrics with underscores, colons, hyphens, and single-level namesFixes
:in regexThe validation was originally designed for Graphite bridge metrics but is too restrictive for
CustomMappingSampleBuilderwhich needs to handle arbitrary Dropwizard metric names.@fstab @dhoard @zeitlinger @jaydeluca when you have a chance would appreciate your review :)