Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 1.63 KB

prometheus.md

File metadata and controls

24 lines (19 loc) · 1.63 KB

Prometheus integration

This project is designed to be easy to integrate with prometheus.
For this it contains a metrics endpoint(/metrics on the web server) which contains the measurements as well as usage statistics for the web pages.
Alternatively there is also the prometheus pushgateway integration which makes this program push these metrics to a prometheus pushgateway instance to allow use in prometheus, but more about that in its own file.

Setup

This assumes you already have a running prometheus server.

  1. Make sure ENABLE_PROMETHEUS_SCRAPE_SUPPORT is set to 1 in config.h.
  2. Build and flash this program again if it wasn't enabled before.
  3. Add something like the example below to your prometheus.yml configuration file in the scrape_configs section.
  4. Reload your prometheus config, for example by restarting prometheus.

Example prometheus.yml config section:

  - job_name: esp-wifi-thermometer
    static_configs:
    - targets: ['ESP_IP:80']

Make sure to replace ESP_IP with the ip address of your ESP.
This program writes the local IP address of the ESP to the Serial console on startup.

If you are using a prometheus on kubernetes (for example kube-prometheus or cluster-monitoring) you can use the kube prometheus integration instead.