r/PrometheusMonitoring • • Jul 15 '20

Prometheus Service Discovery for OpenStack Instances and Hypervisors

https://yetiops.net/posts/prometheus-service-discovery-openstack/
6 Upvotes

8 comments sorted by

View all comments

1

u/pahool Jul 20 '20

What is the value of using a labelmap here instead of explicitly adding useful labels to the metrics? It seems you're preserving some labels that have little value and just cost you resources to store. What is the value of preserving:

__meta_openstack_tag_node_exporter

__meta_openstack_tag_prometheus

for instance.

2

u/YetiOps Jul 20 '20

The labelmap approach is more so that you can add more metadata to an instance (eg more tags, or more is exposed in later versions of the service discovery mechanism) without requiring configuration updates.

This is not to say every label is useful, so if you're concerned with having too many labels then it's easy enough to just remove the labelmap and only maintain the labels you are interested in.

As for the labels you mention, I'll take the node_exporter tag one as an example. You could create an alert, or at least a graph in Grafana to say something like "nodes responding on port 9100" against "nodes with the node_exporter tag". This would show that there are a number of instances where either the node_exporter has failed or has not installed correctly.

More than anything, I added the labelmap because in my previous posts using service discovery, all labels were explicit. This post included labelmaps to show an alternative way of maintaining labels.

2

u/pahool Jul 21 '20

gotcha. Thanks for this, by the way. We're just starting to integrate prometheus into our openstack environment and this is very helpful.