go-graphite / graphite-clickhouse

Graphite cluster backend with ClickHouse support
MIT License
213 stars 52 forks source link

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

Closed mchrome closed 4 months ago

mchrome commented 6 months ago

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

  3. When use-carbon-behaviour=true.
    • Terms with = op and empty value (e.g. t=) match all metrics that don't have that tag.
  4. 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 .