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

Regex should match both with and without a label #395

Closed
dima-vm opened this issue Mar 30, 2020 · 3 comments
Closed

Regex should match both with and without a label #395

dima-vm opened this issue Mar 30, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@dima-vm
Copy link
Contributor

dima-vm commented Mar 30, 2020

Describe the bug
Query metric_name{foo~="bar|"} doesn't return metrics with no label at all (notice | in regex)

To Reproduce

  1. There is a metric that's scrapped both with and without a label, e.g.
metric_name 1.2345
metric_name{foo="bar"} 2.345
metric_name{foo="baz"} 3.456
  1. Query metric_name{foo~="bar|"

Expected behavior
Should return:

metric_name
metric_name{foo="bar"}

but not

metric_name{foo="baz"}
@valyala valyala added the bug Something isn't working label Mar 30, 2020
@valyala
Copy link
Collaborator

valyala commented Mar 30, 2020

Confirmed the bug. It will be fixed soon

valyala added a commit that referenced this issue Mar 30, 2020
…does

Such filters must match all the time series with `label="foo"` plus all the time series without `label`

Previously only time series with `label="foo"` were matched.

Updates #395
@valyala
Copy link
Collaborator

valyala commented Mar 30, 2020

The bug should be fixed in the following commits:

These commits will be included into the next release.

@valyala
Copy link
Collaborator

valyala commented Mar 31, 2020

The bugfix is available starting from v1.34.5

@valyala valyala closed this as completed Mar 31, 2020
valyala added a commit that referenced this issue Sep 9, 2021
…empty labels such as foo{bar=~"baz|",x=~"y|"}

Updates #1601
Updates #395
valyala added a commit that referenced this issue Sep 9, 2021
…empty labels such as foo{bar=~"baz|",x=~"y|"}

Updates #1601
Updates #395
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants