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

receive: expanded postings fixes #126

Merged
merged 2 commits into from
Dec 9, 2024
Merged

Conversation

GiedriusS
Copy link
Collaborator

  • Increase hash seed size. Perhaps in prod we have more than 1 million unique metric names in some tenant(-s)?
  • Add test that fuzzes queries against two receivers. One of them has expanded postings cache enabled.
  • Use fnv1a instead of xxhash like in Cortex. Perhaps fnv1a has a more uniform distribution? Not really sure why that would have any impact.

Also, I've tested this in prod with some ad-hoc feature flag functionality through os.Stat(). Cannot see any impact anymore.

- Increase hash seed size. Perhaps in prod we have more than 1 million
  unique metric names in some tenant(-s)?
- Add test that fuzzes queries against two receivers. One of them has
  expanded postings cache enabled.
- Use fnv1a instead of xxhash like in Cortex. Perhaps fnv1a has a more
  uniform distribution? Not really sure why that would have any impact.

Also, I've tested this in prod with some ad-hoc feature flag
functionality through os.Stat(). Cannot see any impact anymore.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
@GiedriusS GiedriusS force-pushed the expandedpostings_fixes branch from 07fd124 to 912b961 Compare December 9, 2024 10:55
for _, m := range ms {
if m.Name == labels.MetricName && m.Type == labels.MatchEqual {
return m.Value, true
if metricName != "" {
return "", false
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention here is to return "", false if two Matchers match the given metric name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose is to not cache if there more than two matchers on __name__. Technically such queries don't make sense and will never return results but just in case to avoid filling the cache with empty items

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
@GiedriusS GiedriusS merged commit 443ed63 into v0.37.0+vinted Dec 9, 2024
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants