Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web...

25
Using Prometheus and Grafana for monitoring my power usage Erwin de Keijzer Linux Engineer @ Snow @erwindekeijzer github.com/gnur https://snow.nl

Transcript of Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web...

Page 1: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

Using Prometheus and Grafana for monitoring my

power usageErwin de Keijzer

Linux Engineer @ Snow

@erwindekeijzer

github.com/gnur

https://snow.nl

Page 2: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

This is about my washing machine

Page 3: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

13:30 (ETA: 14:46)

Page 4: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

14:48 (ETA: 15:03)

Page 5: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

15:04 (ETA: 15:14)

Page 6: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

15:23 (ETA: 15:33)

Page 7: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads
Page 8: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

Main quest: get notifications when the washing machine is done

Side quest: secure, private web interface for exploring power usage

Let’s go from pulling to pushing

Page 9: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

The Setup

Page 10: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads
Page 11: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

• Reads /dev/ttyUSB0

• Stores relevant info in global vars

• Exposes these metrics using the promhttp library (official go

prometheus library)

• Prometheus scrapes the endpoint

Prometheus-p1-exporter

Page 12: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

prometheus p1

exporter

Page 13: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

Prometheus

Page 14: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

prometheus p1

exporter

Page 15: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

Grafana

Page 16: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

prometheus p1

exporter

Page 17: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

prometheus p1

exporter

Page 18: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

Quiz

A B C

Page 19: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

Quiz

A B C

Washing machineMicrowave

Oven

Page 20: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

Main quest: get notifications when the washing machine is done

Side quest: secure, private web interface for exploring power usage

Let’s go from pulling to pushing

Page 21: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

Main quest: get notifications when the washing machine is done

Side quest: secure, private web interface for exploring power usage

Let’s go from pulling to pushing

Page 22: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

Main quest: get notifications when the washing machine is done

Side quest: secure, private web interface for exploring power usage

Let’s go from pulling to pushing

Page 23: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

Interesting graph #1

Page 24: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

Interesting graph #2

Page 25: Using Prometheus and Grafana for monitoring my power usage...Side quest: secure, private web interface for exploring power usage Let’s go from pulling to pushing The Setup • Reads

https://prometheus.io

https://grafana.com/

https://caddyserver.com/

https://github.com/gnur/prometheus-p1-exporter

https://github.com/prometheus/client_golang

https://github.com/prometheus/alertmanager

Sources