graphite-clickhouse icon indicating copy to clipboard operation
graphite-clickhouse copied to clipboard

tagger: add two feature-flags that change seriesByTag behavior

Open mchrome opened this issue 1 year ago • 0 comments

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 #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 avatar Mar 06 '24 10:03 mchrome