Skip to content

Add --validation-scheme flag for UTF-8 metric name support #59

@friedrichg

Description

@friedrichg

Summary

The Prometheus rulefmt.Rule.Validate() method now accepts a model.ValidationScheme parameter that controls whether metric and label names must follow legacy Prometheus naming rules or can be any valid UTF-8 string.

Currently cortex-tools hardcodes model.LegacyValidation. As Cortex and Prometheus adopt UTF-8 metric name support, users should be able to control this.

Proposal

Add a --validation-scheme flag (default legacy) to rule-related commands:

  • rules check
  • rules lint
  • rules load

Accepted values:

  • legacy — metric/label names must match [a-zA-Z_:][a-zA-Z0-9_:]*
  • utf8 — only requires valid UTF-8 strings

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions