Allow colon in Prometheus meter name; add test #9689
Merged
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.
Description
Resolves #9686
Release note:
Helidon now correctly includes in the Prometheus/OpenMetrics output data for meters with colons in their names. They were previously excluded from Prometheus/OpenMetrics output although they were included in the JSON output and were correctly registered in the meter registry.
A colon is, in fact, a legal character in Prometheus meter names. The Helidon logic that queries the Micrometer Prometheus meter registry prepares a list of names to scrape to get the output. That logic was incorrectly replacing a ":" in meter names with an "_", treating it as an illegal character in meter names.
This PR corrects that replacement.
For example, a "?" is truly illegal and the Micrometer Prometheus meter register converts them to "" before storing the names in that registry. So the Helidon code that prepares the names for scraping continues to replace "?" with "". It just no longer replaces ":" as it used to.
The PR also contains a test to make sure that names with colons (valid name character) and
Documentation
No impact.