graphite-clickhouse
graphite-clickhouse copied to clipboard
tagger: add two feature-flags that change seriesByTag behavior
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
- From #244.
seriesByTag("name=test","env!=~stage|env")now returns both metrics. - Given:
request_success_total.counter;app=test;project=Test;environment=TEST;t=q request_success_total.counter;app=test;project=Test;environment=TEST;t=qacTargetseriesByTag('t!=~qac')didn't return anything. Now it returnsrequest_success_total.counter;app=test;project=Test;environment=TEST;t=qThis only happened when a term with!=~was the first tag after sorting terms by cost.
Changes with feature flags
- When
use-carbon-behaviour=true.
- Terms with
=op and empty value (e.g.t=) match all metrics that don't have that tag.
- When
dont-match-missing-tags=true.
- Terms with
!=and!=~operators only match metrics that have that tag. For example, withoutdont-match-missing-tags=trueseriesByTag('t!=abc')would matchmetric.name;tag=val.