Jerome Ortega
Jerome Ortega

Reputation: 105

What does somestring1_somestring2:metric_name:some_operation mean in prometheus query language

I am trying to understand default prometheus rules for kubernetes. And then I came across with this expression:

      sum(namespace_cpu:kube_pod_container_resource_requests:sum{})
        /
      sum(kube_node_status_allocatable{resource="cpu"})
        >
      ((count(kube_node_status_allocatable{resource="cpu"}) > 1) - 1) / count(kube_node_status_allocatable{resource="cpu"})

Specifically, i am curious at namespace_cpu:kube_pod_container_resource_requests:sum{}. namespace_cpu does not appear to be an operation or reserved word in promql.

I can't seem to find it either in Prometheus documentation. https://prometheus.io/docs/prometheus/latest/querying/basics/

Any hints?

Upvotes: 1

Views: 506

Answers (1)

coderanger
coderanger

Reputation: 54251

Nothing, it's not an operator : is just a legal character in metric names. Some standard rulesets use it for grouping rollup rules together but it's just a naming scheme at most.

Upvotes: 3

Related Questions