You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are sourcing multiple Kubernetes clusters into a single M3 environment. Metrics have the usual names found in kubelet, kubelet/cadvisor and kube-state-metrics. An additional label environment is used to disambiguate the clusters.
We are building similar dashboards to some of those provided by prometheus-operator with customisations for our needs.
Problem statement
The PromQL matcher container_name!="" does not appear to be working in the following query:
the difference is that Prometheus doesn’t keep time series with empty labels, but M3 does I believe. On top of that though it seems “!=“ is not being applied properly
Workaround
Using the !~ operator does not work any better, however combining with unless does work:
We have a proxy in front of m3query and are doing this to fix the problem:
// m3Query incorrectly treats label matchers like:// `up{not_exists!=""}`// as// `up{}`// instead of// `up{not_exists=~".+"}// This should have been fixed in v0.14.2 (https://github.com/m3db/m3/commit/e3d0f4fc3396158873023ae775948335875a75af)//but the queries still behave the same wayfuncNormalizeMatchers(matchers []*prompb.LabelMatcher) {
for_, m:=rangematchers {
ifm.Type==prompb.LabelMatcher_NEQ&&m.Value=="" {
m.Type=prompb.LabelMatcher_REm.Value=".+"
}
}
}
Context
We are sourcing multiple Kubernetes clusters into a single M3 environment. Metrics have the usual names found in
kubelet
,kubelet/cadvisor
andkube-state-metrics
. An additional labelenvironment
is used to disambiguate the clusters.We are building similar dashboards to some of those provided by
prometheus-operator
with customisations for our needs.Problem statement
The PromQL matcher
container_name!=""
does not appear to be working in the following query:We get two results back, one with the expected container name and one with an empty
container_name
label.Verification
Executing this query directly against Prometheus yields the expected outcome.
Analysis
@robskillington noted that:
Workaround
Using the
!~
operator does not work any better, however combining withunless
does work:M3 Configuration
Placement
Namespaces
The text was updated successfully, but these errors were encountered: