Working with PromQL
PromQL has three data types: instant vectors, range vectors, and scalars. An instant vector is a time series of data samples; a range vector is a set of time series containing data within a certain time range; and a scalar is a numeric floating value. Metrics stored inside Prometheus are identified with a metric name and labels, and we can find the name of any collected metric with the drop-down list next to the Execute button in the expression browser. If we query Prometheus using a metric name, say http_requests_total, we'll get lots of results, as instant vectors often have the same name but with different labels. Likewise, we can also query a particular set of labels using the {} syntax. For example, the query {code="400",method="get"} ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access