Prometheus’s data model
Prometheus’s data model is – in my opinion – straightforward. It has three main data types that are all built on each other: metrics, time series, and samples.
Metrics
Metrics are the fundamental Prometheus data type. After all, Prometheus is a metrics-focused observability tool.
Every metric has – at a minimum – a name that identifies it. This name can contain letters, digits, underscores, and/or colons. To be valid, it must match the [
a-zA-Z_:][a-zA-Z0-9_:]*
regex.
Additionally, metrics may also include a HELP
text and a TYPE
field. These are optional but highly recommended to improve usability.
A full metric that’s been exposed to Prometheus may look like this:
# HELP mastering_prometheus_readers_total Number of readers of this book # TYPE mastering_prometheus_readers_total counter mastering_prometheus_readers_total 123467890
The HELP
line just provides some arbitrary information on what...