canonical / nrpe_exporter

Apache License 2.0
49 stars 18 forks source link

Add "check" label #28

Closed peppepetra closed 1 year ago

peppepetra commented 1 year ago

Enhancement Proposal

As an operator when I get an alert I would like to quickly identify the check and the unit that is firing. For the unit I can use labels.juju_unit but I am missing a check label.

I can extract that from the job, but it would be good to have that out of the box.

Right now I can workaround that using a rule with the following expression:

label_replace(avg_over_time(command_status{juju_model="openstack"}[5m]), "check", "$1", "job", ".*.(check_.*)_prometheus_scrape") > 1

The above will produce metrics like the following:

{check="check_prometheus_libvirt_exporter_http", host="192.168.11.105", instance="192.168.11.105:5666", job="juju_openstack_666cbd0_mycontext_mycloud_myhost_check_prometheus_libvirt_exporter_http_prometheus_scrape", juju_application="nrpe", juju_model="openstack", juju_model_uuid="666cbd0e-58a4-4951-8b75-9b5ca9733f2f", juju_unit="mycontext-mycloud-myhost"}
rbarry82 commented 1 year ago

This is actually done by the nrpe_exporter library in cos-proxy, but it's in-progress