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=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
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, without dont-match-missing-tags=trueseriesByTag('t!=abc') would match metric.name;tag=val .
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
seriesByTag("name=test","env!=~stage|env")
now returns both metrics.request_success_total.counter;app=test;project=Test;environment=TEST;t=q request_success_total.counter;app=test;project=Test;environment=TEST;t=qac
TargetseriesByTag('t!=~qac')
didn't return anything. Now it returnsrequest_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
use-carbon-behaviour=true
.=
op and empty value (e.g.t=
) match all metrics that don't have that tag.dont-match-missing-tags=true
.!=
and!=~
operators only match metrics that have that tag. For example, withoutdont-match-missing-tags=true
seriesByTag('t!=abc')
would matchmetric.name;tag=val
.