Skip to content

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 .

@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
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