[chore] Make Semantic Convention metric name character set explicit#3721
Open
cijothomas wants to merge 3 commits into
Open
[chore] Make Semantic Convention metric name character set explicit#3721cijothomas wants to merge 3 commits into
cijothomas wants to merge 3 commits into
Conversation
Contributor
|
Should a rego policy enforce this? |
Adds a metric_name_regex matching the rule documented in docs/general/naming.md (^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)*$) and applies it to the metric_name yaml_schema check, replacing the more general name_regex previously used there. Tests are updated to cover the metric-specific cases (e.g. 'foo.1bar' is rejected for metrics even though it remains valid for attributes/events/resources).
Member
Author
I made an attempt and pushed a commit - let me know if that was your suggestion. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Adds a normative rule that metric instrument names defined by Semantic Conventions must match the regular expression
[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)*— lowercase ASCII alphanumerics and underscores, separated by dots into namespaces.This is a codification of the existing convention. None of the existing semconv metric names are affected.
Why now
The OpenTelemetry Specification is considering opentelemetry-specification#5092, which expands the API-level allowed character set for user-defined instrument names. Making the semconv-side rule explicit removes any ambiguity about whether the broader API-level allowlist applies to semconv-defined metric names — it doesn't.