Prometheus stores all data as time series. It is a stream of timestamped values that belong to the same metric and the same labels. The labels provide multiple dimensions to the metrics.
For example, if we'd like to export data based on HTTP requests from the proxy
, we might create a metric called proxy_http_requests_total
. Such a metric could have labels with the request
method, status
, and path
. These three could be specified as follows:
{method="GET", url="/demo/person", status="200"}
{method="PUT", url="/demo/person", status="200"}
{method="GET", url="/demo/person", status="403"}
Finally, we need a value of the metric, which, in our example, would be the total number of requests.
When we combine metric names with the labels and values, the example result could be as follows:
proxy_http_requests_total{method="GET", url="/demo/person", status="200"} 654
proxy_http_requests_total{method="PUT", url="/demo/person", status="200"} 143
proxy_http_requests_total{method="GET", url...