Prometheus is an open source software for metrics collection, aggregation, visualization (graphs) and alerting.
Presentation at the Cloud Native Computing Meetup in Zürich, Switzerland on January 11 2018
Right Money Management App For Your Financial Goals
Introduction to Prometheus
1. VSHN AG I Neugasse 10 I 8005 Zürich I T 044 545 53 00 www.vshn.ch
Prometheus
Aarno Aukia, CTO & co-founder VSHN
@aarnoaukia, aarno.aukia@vshn.ch
VSHN AG - The DevOps Company
Since 2014, 22 people in Zürich
https://vshn.ch @vshn_ch
2. VSHN AG I Neugasse 10 I 8005 Zürich I T 044 545 53 00 www.vshn.ch
Prometheus History
●
Started 2012 by Julius & Björn @
SoundCloud, Berlin
●
Inspired by Borgmon (Google-internal)
●
Metrics/time-series with
●
Multi-dimensional data model
●
Simple ops
●
Decentralized = scalable, pull, HTTP
●
Powerful querying for alerts & graphs using
multi-dimensionality
●
CNCF project nr 2 since 2016
3. VSHN AG I Neugasse 10 I 8005 Zürich I T 044 545 53 00 www.vshn.ch
Multi dimensional data model: what?!
●
Time series have
●
1 name (e.g. flask_request_count)
●
as many labels as necessary
●
endpoint="/"
●
http_status="200"
●
instance="imapflagged:8080"
●
job="imapflagged"
●
method="GET"
●
A numeric value (counter or gauge)
●
A timestamp
●
Example:
https://calproxy-vshn-xingsync.appuioapp
.ch/metrics
4. VSHN AG I Neugasse 10 I 8005 Zürich I T 044 545 53 00 www.vshn.ch
Prometheus architecture
5. VSHN AG I Neugasse 10 I 8005 Zürich I T 044 545 53 00 www.vshn.ch
Example Applications
●
Kubernetes-cluster (OpenShift/appuio.ch)
●
Prometheus-container
●
http://docs.appuio.ch/en/latest/app/prometheus.
html
●
https://prometheus-aarno-srf2spotify.appuioapp.
ch/
●
Pushgateway-container
●
Imapflagged-service
●
https://github.com/arska/imapflagged
●
Calproxy-service
●
https://github.com/arska/calproxy
6. VSHN AG I Neugasse 10 I 8005 Zürich I T 044 545 53 00 www.vshn.ch
Querying 1/2
●
flask_request_size_bytes
●
flask_request_size_bytes{endpoint="/aar
no"}
●
flask_request_size_bytes{endpoint="/aar
no", http_status="200"}
●
rate(flask_request_count[15m])
●
sum(rate(flask_request_count[15m])) by
(job)
●
process_start_time_seconds
7. VSHN AG I Neugasse 10 I 8005 Zürich I T 044 545 53 00 www.vshn.ch
Querying 2/2
●
sum(process_max_fds -
process_open_fds) by (job)
●
topk(2,
sum(rate(process_cpu_seconds_total[15
m])) by (job))
●
rate(flask_request_latency_seconds_sum[
15m])/rate(flask_request_latency_second
s_count[15m])
8. VSHN AG I Neugasse 10 I 8005 Zürich I T 044 545 53 00 www.vshn.ch
Exporting metrics
●
https://prometheus.io/docs/instrumentin
g/exporters/
●
Example exporting custom metrics
●
https://github.com/arska/calproxy/blob/
master/app.py
9. VSHN AG I Neugasse 10 I 8005 Zürich I T 044 545 53 00 www.vshn.ch
Thanks!
Interested in
Cloud Native Technologies?
We're hiring!
https://vshn.ch/jobs
https://stackoverflow.com/jobs/143639/sit
e-reliability-engineer-sre-and-devops-eng
ineer-vshn
@vshn_ch @aarnoaukia