-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Provide optional matchers to LabelValuesForMetricName
.
#4933
Conversation
e6ba855
to
81f2a64
Compare
fooChunk1, | ||
fooChunk2, | ||
}); err != nil { | ||
t.Fatal(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was copied from chunk_store_test.go
but fails with series_store_test.go:70: table not found: cortex_chunks2710
. Not sure what's going on.
The test passes when run individually. However, it fails when all tests are run together. The Just checked. If the test runs at the beginning by renaming it |
mtime.NowForce(baseTime) | ||
defer mtime.NowReset() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this was nasty. Could we inject a time interface instead similar to injecting a logger?
if err != nil { | ||
return nil, err | ||
} | ||
seriesIDsSet := make(map[string]struct{}, len(seriesIDs)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: not sure using a map will be better. We can take a look at this later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Cyril Tovena <cyril.tovena@gmail.com>
What this PR does / why we need it:
In some cases we want to fetch label values from a limited set of series. This can be done by passing label matchers for the series to the
LabelValuesForMetricName
method. The matchers are applied first to filter out all chunk ids that matcher all of them. Then we fetch all label values and filter out those that are part of the chunks.Checklist
CHANGELOG.md
about the changes.