Prometheus Tips and Tricks

This wiki is for Prometheus users to share configs, rules, expressions, dashboards and other tips.


Add a new tip or solution

Adding a tip is easy.

  • first think of some name for your tip
  • create a page (using the form below)
  • assign page tags to the created page

Highest Rated Tips

EC2 Discovery Relabelling (Rating: 3)

Let’s say you are on EC2 and wanted to use the Name tag rather than the private IP and port you’d get by default with EC2 service discovery. You could use a relabel rule like:

Accessing a subset of prometheus endpoints over SSL+auth (Rating: 1)

Prometheus configuration to scrape from such a node behind SSL and basic auth. Assumes your Prometheus scrape target has a pukka SSL/TLS server certificate (otherwise use your own CA etc.).

Basic auth with Caddy webserver (Rating: 1)

Here's a simple Caddyfile to add basic auth in front of prometheus and alertmanager :

Average of a Summary/Histogram (Rating: 1)

If you have a Summary or Histogram how do you get the average latency/bytes/whatever?

Prometheus Config for SNMP exporter (Rating: 1)

The configuration for the SNMP exporter inPrometheus should look like:

service discovery with mesos-dns (Rating: 0)

How to service discovery with mesos dns for prometheus ?

HAProxy reverse proxy for Prometheus with SSL and Auth (Rating: 0)

The following configuration uses HAProxy to act as a reverse proxy for Prometheus node data collection with SSL and http auth.

Apache reverse proxy for Prometheus (Rating: 0)

This is a simple configuration for Apache to act as a reverse proxy for Prometheus, allowing for SSL and/or user authentication. It should be on its own VirtualServer.

Nginx Reverse Proxy for Prometheus (Rating: 0)

Here’s an Nginx configuration that simply acts as a reverse proxy from Prometheus on port 9090 to port 80:

Recently Added Tips

service discovery with mesos-dns (Rating: 0)

How to service discovery with mesos dns for prometheus ?

Accessing a subset of prometheus endpoints over SSL+auth (Rating: 1)

Prometheus configuration to scrape from such a node behind SSL and basic auth. Assumes your Prometheus scrape target has a pukka SSL/TLS server certificate (otherwise use your own CA etc.).

HAProxy reverse proxy for Prometheus with SSL and Auth (Rating: 0)

The following configuration uses HAProxy to act as a reverse proxy for Prometheus node data collection with SSL and http auth.

Apache reverse proxy for Prometheus (Rating: 0)

This is a simple configuration for Apache to act as a reverse proxy for Prometheus, allowing for SSL and/or user authentication. It should be on its own VirtualServer.

Basic auth with Caddy webserver (Rating: 1)

Here's a simple Caddyfile to add basic auth in front of prometheus and alertmanager :

Average of a Summary/Histogram (Rating: 1)

If you have a Summary or Histogram how do you get the average latency/bytes/whatever?

Nginx Reverse Proxy for Prometheus (Rating: 0)

Here’s an Nginx configuration that simply acts as a reverse proxy from Prometheus on port 9090 to port 80:

Prometheus Config for SNMP exporter (Rating: 1)

The configuration for the SNMP exporter inPrometheus should look like:

EC2 Discovery Relabelling (Rating: 3)

Let’s say you are on EC2 and wanted to use the Name tag rather than the private IP and port you’d get by default with EC2 service discovery. You could use a relabel rule like:

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License