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

tagger: add two feature-flags that change seriesByTag behavior #266

Merged

Conversation

mchrome
Copy link
Collaborator

@mchrome mchrome commented Mar 6, 2024

This PR intends to fix two unintended (i believe) behaviors and adds two feature flags which affect what metrics are returned after filtering with seriesByTag.

Changes that work without feature flags

  1. From seriesByTag invalid regular expression parsing #244.
    seriesByTag("name=test","env!=~stage|env") now returns both metrics.
  2. Given:
    request_success_total.counter;app=test;project=Test;environment=TEST;t=q request_success_total.counter;app=test;project=Test;environment=TEST;t=qac
    Target seriesByTag('t!=~qac') didn't return anything.
    Now it returns request_success_total.counter;app=test;project=Test;environment=TEST;t=q
    This only happened when a term with !=~ was the first tag after sorting terms by cost.

Changes with feature flags

  1. When use-carbon-behaviour=true.
  • Terms with = op and empty value (e.g. t=) match all metrics that don't have that tag.
  1. When dont-match-missing-tags=true.
  • Terms with != and !=~ operators only match metrics that have that tag.
    For example, without dont-match-missing-tags=true seriesByTag('t!=abc') would match metric.name;tag=val .

finder/tagged.go Outdated Show resolved Hide resolved
finder/tagged_test.go Outdated Show resolved Hide resolved
finder/tagged_test.go Outdated Show resolved Hide resolved
@mchrome mchrome marked this pull request as ready for review March 13, 2024 08:54
@mchrome mchrome changed the title tagger: fix several cases where gch behavior is different from carbon tagger: add two feature-flags that change seriesByTag behavior Mar 13, 2024
@msaf1980 msaf1980 merged commit e59296b into go-graphite:master Apr 24, 2024
7 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.

3 participants