Skip to content

Bug: Regex handling issues in tenant federation (Cortex v1.20 / Grafana datasource) #7413

@alexinfoblox

Description

@alexinfoblox

Environment
Cortex version: 1.20

Configuration:

tenant_federation:
  enabled: true
  regex_matcher_enabled: true

Client: Grafana (Prometheus datasource)

Description

We observed unexpected behavior when using regex-based tenant matching in the Grafana datasource configuration with tenant federation enabled.
Specifically, certain regex patterns either fail validation or produce incomplete query results.

Issue 1: Unsupported + character at end of regex

cluster-dev-.+

This produces a validation/parsing error (see screenshot).
Image

However, the same operator works correctly when used in the middle of the expression: cluster-.+-dev

Issue 2: Missing time series when regex ends with .* and there is only one tenant that matches the regex pattern

When using a regex pattern that ends with .*, e.g.: cluster-stage-.* and there is only one tenant ID matching the regex, like cluster-stage-1,
We observe that data is missing for approximately the last 6 hours

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions