Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow colon in Prometheus meter name; add test #9689

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

tjquinno
Copy link
Member

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.

@tjquinno tjquinno self-assigned this Jan 24, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 24, 2025
@tjquinno tjquinno merged commit c39850f into helidon-io:main Jan 24, 2025
58 checks passed
@tjquinno tjquinno deleted the 4.x-meter-name-with-colon branch January 24, 2025 19:35
@tjquinno tjquinno mentioned this pull request Jan 21, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4.x Meter with a colon in its name does not appear in Prometheus output
2 participants