I have one query where I am trying to join two metrics on a label. K_Status_Value == 5 and ON(macAddr) state_details{live="True"}
The label macAddr is present in both the metrics. The value of the label appears in 'K_Status_Value' sometimes in upper case (78:32:5A:29:2F:0D) and sometimes in lower case (78:72:5d:39:2f:0a) but always appears in upper case for 'state_details'. Is there any way I can make the label macAddr value case-insensitive in the query so that I don't miss out on the occurrences where the cases don't match?
Querying Prometheus. Prometheus provides a functional query language called PromQL (Prometheus Query Language) that lets the user select and aggregate time series data in real time. The result of an expression can either be shown as a graph, viewed as tabular data in Prometheus's expression browser, or consumed by external systems via the HTTP API.
The Data can be exposed to Prometheus through client libraries and exporters. Client libraries can help you create & expose metrics from your application code, and exporters are being used when you can’t change the application’s source code. Prometheus uses various exporters to monitor third-party applications like an HTTP server or a database.
The alerting rules can be configured in Prometheus, but a separate component called Alertmanager is needed to manage the alerts. For visualization, You can use PromQL to query the metrics and generate graphs in the Prometheus web UI.
Prometheus is an open source metrics-based monitoring system. It has a multi-dimensional data model and has a strong query language to query that data model. This blog post will discuss monitoring in general and Prometheus from a beginner’s point of view.
I can think of two options
To quote Ben Kochie on Prometheus user mailing list:
The regexp matching in Prometheus is based on RE2 I think you can set flags within a match by using
(?i(matchstring))
It works indeed: this metric up{instance="localhost:9090",job="prometheus"}
is matched by this expression :
up{job=~"(?i:(ProMeTHeUs))"}
This hint won't help in the case described above. It won't help either to join on (xx)
or group_left
.
I was initialy hoping to use a recording rule to lower case at ingestion time (in prometheus.yml
). However this features is not implemented at this time (issue 1548)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With