Python is one of the four languages that has an official Prometheus client. Let's take a quick look at how to use it.
A blog on monitoring, scale and operational Sanity
Python is one of the four languages that has an official Prometheus client. Let's take a quick look at how to use it.
I've previously mentioned that you shouldn't have the version of your software as either a target label, or exposed via a label on all metrics of your server as it'll make using the metrics more challenging. What should you do instead?
I previously talked about writing JSON exporters in Python for Prometheus. Since then, the API for custom collectors in the Python client has been improved. So let's see how easy it is to create a new exporter!
Prometheus doesn't try to lock you into it's ecosystem - in fact it makes it straightforward to both get data both in and out. This reduces operational overhead and allows for smoother transitions between monitoring systems.
Prometheus monitoring is usually against on long-lived daemons, but what if you've a batch job that you want to monitor?
Prometheus offers integrations with systems like PagerDuty, Email and Hipchat for alert notifications - but what if you want do something that's not supported out of the box? The Alertmanager's generic web hook has got you covered.
A common question is is there a way to ingest JSON metrics from a random system into Prometheus? It's not possible to extract useful metrics from an arbitrary JSON blob, so that's not something the can be offered out of the box. However it's easy to write an exporter in Python to produce meaningful metrics.