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

fix: allow slashes in application name #137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

marcsanmi
Copy link
Contributor

@marcsanmi marcsanmi commented Nov 27, 2024

See grafana/pyroscope#3722.

Also added missing tests.

@marcsanmi marcsanmi requested review from a team as code owners November 27, 2024 16:12
@marcsanmi marcsanmi force-pushed the marcsanmi/allow-slashes-app-name branch from 7e1216c to 7d0a678 Compare November 27, 2024 16:14
@@ -101,7 +101,7 @@ func IsTagKeyRuneAllowed(r rune) bool {
}

func IsAppNameRuneAllowed(r rune) bool {
return r == '-' || r == '.' || IsTagKeyRuneAllowed(r)
return r == '-' || r == '.' || r == '/' || IsTagKeyRuneAllowed(r)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we want to get rid of the internal/flameql and unify the way we handle labels. I propose to explore a way where we use the exact same parsing and validation as in the Push API and treat labels as Prometheus ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I'll create an issue to explore this further. I had to replicate this change in three places (Pyroscope, Alloy, and here), so it's definitely not the ideal approach 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I had already created it when I needed to duplicate the logic in Alloy https://github.com/grafana/pyroscope-squad/issues/257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants