Skip to content

remove global name validation #892

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

Closed
wants to merge 9 commits into from

Conversation

juliusmh
Copy link
Contributor

@juliusmh juliusmh commented Jun 16, 2025

This PR introduces explicit APIs to set validation scheme for various components of prometheus.

Uses / Depends on:

@juliusmh juliusmh force-pushed the remove_global_name_validation branch 3 times, most recently from f9c5913 to e0e77cf Compare June 17, 2025 09:15
@juliusmh juliusmh force-pushed the remove_global_name_validation branch from e0e77cf to 8092852 Compare June 18, 2025 09:21
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

Instead of pkg/util/validation.IsValidLabelName and pkg/util/validation.IsValidMetricName, I think a more forward looking solution would be to implement a method pkg/util/validation.Overrides.NameValidationScheme(tenantID string) validation.NamingScheme, and use that wherever you need to validate metric or label names. It can hard-code the legacy scheme, so we don't make it configurable at first. If we have such a solution, we can easily implement the next step, which is per-tenant configurability of metric/label name validation scheme.

@juliusmh juliusmh force-pushed the remove_global_name_validation branch 3 times, most recently from 31aff3b to 2ceae43 Compare June 24, 2025 17:50
@juliusmh juliusmh force-pushed the remove_global_name_validation branch 3 times, most recently from af1fe5f to 0f47658 Compare June 30, 2025 09:08
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

It doesn't seem right to me to essentially duplicate prometheus/common/model.ValidationScheme via model/validation.NamingScheme. It's going to be bad to maintain, and a potential footgun. Please see my alternative suggestion :)

@juliusmh juliusmh force-pushed the remove_global_name_validation branch from 0f47658 to ef1d8b1 Compare July 1, 2025 11:42
@juliusmh juliusmh force-pushed the remove_global_name_validation branch from ef1d8b1 to c0349fd Compare July 4, 2025 09:12
@juliusmh juliusmh closed this Jul 22, 2025
@juliusmh
Copy link
Contributor Author

Superseded by #946

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.

3 participants