Skip to content

AirGradient Pro v4.2 Arduino Sketch to track metrics to a Prometheus Pushgateway.

License

Notifications You must be signed in to change notification settings

inversion/airgradient-pro-prometheus-pushgateway

Repository files navigation

airgradient-pro-prometheus-pushgateway

AirGradient Pro v4.2 Arduino Sketch to track metrics to a Prometheus Pushgateway.

Here, pushgateway is used to avoid network access problems where the Prometheus server is on a different network, and NAT port forwarding cannot be configured. Prometheus only recommend using pushgateway for batch jobs. If you don't need to use pushgateway, you should probably use airgradient-prometheus over this (but it doesn't log the extra Pro sensor fields at time of writing).

Tested with an HTTPS pushgateway host, possibly needs modifications to work with insecure HTTP.

  1. Save certificate chain for your pushgateway domain: cert.py -s example.com -n pushgateway_domain > certs.h
  2. Follow the Arduino setup instructions for flashing the AirGradient sensor. Make sure you connect the USB-C cable to the chip - not the power port on the back of the housing.
  3. Install the following libraries from the Arduino library manager (Tools -> Manage Libraries):
  4. Open the the code in Arduino Studio.
  5. Configure pushgateway_host and prometheus_http_basic_auth (if desired).
  6. Hit Upload in Arduino Studio.
  7. Check your monitoring set up is receiving data.
  8. grafana.json is the model JSON for an example dashboard to visualize this data (screenshot below).

grafana

References

About

AirGradient Pro v4.2 Arduino Sketch to track metrics to a Prometheus Pushgateway.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published