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

chore: allow dashes and dots in the metric label values #5451

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

IuryAlves
Copy link

@IuryAlves IuryAlves commented Mar 27, 2025

what

Allow dashes and dots in the metric label values.

why

A change was introduced in the commit 893ba90 to sanitize metric label names and values. This change caused dashes and dots in repository names(i.e. the base_repo label) to be converted to underscores.

This change does not comply to the Prometheus Data model specification, as it allows any unicode characters in label values, as documented here.

I also created a pull request to fix it in Tally: uber-go/tally#267, but I am hoping we can merge this PR while we wait for an approval from the tally maintainers.

tests

I couldn't figure out how to test those changes. I would appreciate some support with that.

references

@IuryAlves IuryAlves requested review from a team as code owners March 27, 2025 12:11
@IuryAlves IuryAlves requested review from GenPage, nitrocode and X-Guardian and removed request for a team March 27, 2025 12:11
@dosubot dosubot bot added feature New functionality/enhancement go Pull requests that update Go code labels Mar 27, 2025
IuryAlves and others added 2 commits March 27, 2025 13:24
The commit runatlantis@893ba90 introduced  to the tally.ScopeOptions. This change causes dashes and dots in repository names, the base_repo label,  to be converted to underscores.

The Prometheus Data model allows any unicode characters in label values, as documented [here](https://prometheus.io/docs/concepts/data_model/\#:\~:text\=Label%20values%20may%20contain%20any%20Unicode%20characters.)

Signed-off-by: IuryAlves <iuryalves20@gmail.com>
…drive/utils.go (main) (runatlantis#5449)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: IuryAlves <iuryalves20@gmail.com>
@IuryAlves IuryAlves force-pushed the iury/accept-dashes-and-dots-in-metric-label-values branch from 652f8fc to 1f6d1a1 Compare March 27, 2025 12:24
@github-actions github-actions bot added the build Relating to how we build Atlantis label Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Relating to how we build Atlantis feature New functionality/enhancement go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant