Prometheus Metrics
For how scrape targets are configured and how series are selected, see Prometheus Monitoring.
These metrics are provided by the prometheus subagent.
They read the samples that the subagent keeps in memory from the last successful scrape of each scrape target; a metric request does not contact the endpoint.
Data received through the remote write receiver is not available through these metrics.
The first argument of every metric is the name of a scrape target, as configured in its [Prometheus/Targets/target] section; it is matched case-insensitively.
An unknown target name results in the error no such instance.
Metrics that select a series take optional label=value arguments after the fixed arguments.
A series matches when it has every given label with exactly the given value (case-sensitive); the first matching series in the order of the endpoint response is used.
Metric names are matched exactly (case-sensitive).
Put an argument in double or single quotes if it contains a comma or a parenthesis, for example "path=/a,b" or path="/a,b".
For details and examples, see Selecting a Series.
Series Metrics
Prometheus.LabelValue(target, metric, label[, label=value …])
Value of label label of the first series of metric that matches the label filters.
Use it for info-style metrics that carry their data in labels, for example node_uname_info or node_exporter_build_info.
Returns no such instance when no series matches or the matching series does not have the label label, and an error when the target has had no successful scrape since the agent started.
Data Type |
String |
Platforms |
All ( |
| Argument | Type | Description |
|---|---|---|
target |
String |
Scrape target name |
metric |
String |
Metric name as exposed by the endpoint, for example |
label |
String |
Name of the label whose value is returned |
label=value |
String |
Optional, any number: label filters that select the series |
Prometheus.Value(target, metric[, label=value …])
Value of the first series of metric that matches the label filters.
Without label filters, the first series of the metric is used.
Returns no such instance when no series matches, and an error when the target has had no successful scrape since the agent started.
Data Type |
Float |
Platforms |
All ( |
| Argument | Type | Description |
|---|---|---|
target |
String |
Scrape target name |
metric |
String |
Metric name as exposed by the endpoint, including any suffix such as |
label=value |
String |
Optional, any number: label filters that select the series |
Target Metrics
Prometheus.Target.LastScrapeTime(target)
Time of the last scrape attempt of the target, successful or not, as UNIX time. 0 before the first scrape attempt.
Data Type |
Unsigned Integer 64 |
Platforms |
All ( |
| Argument | Type | Description |
|---|---|---|
target |
String |
Scrape target name |
Prometheus.Target.SampleCount(target)
Number of samples kept from the last successful scrape of the target (one sample per series). A failed scrape does not change it; 0 before the first successful scrape.
Data Type |
Unsigned Integer |
Platforms |
All ( |
| Argument | Type | Description |
|---|---|---|
target |
String |
Scrape target name |
Lists
Prometheus.LabelValues(target, metric, label) (List)
Distinct values of label label across all series of metric, in the order of first appearance in the endpoint response.
Series without the label are skipped.
The list is empty when the metric is not in the last scrape.
Use it as the source of instance discovery with method Agent List when one label identifies a series.
Data Type |
List |
Platforms |
All ( |
| Argument | Type | Description |
|---|---|---|
target |
String |
Scrape target name |
metric |
String |
Metric name |
label |
String |
Label name |
Tables
Prometheus.Series(target, metric) (Table)
All series of metric from the last successful scrape, one row per series.
The table is empty when the metric is not in the last scrape.
Use it as the source of instance discovery with method Agent Table when several labels identify a series.
Data Type |
Table |
Platforms |
All ( |
| Argument | Type | Description |
|---|---|---|
target |
String |
Scrape target name |
metric |
String |
Metric name |
| Column | Type | Description |
|---|---|---|
LABELS |
String |
All labels of the series in the form |
VALUE |
Float |
Sample value |
label name |
String |
One column for each label name that appears in any series of the metric, named after the label, in the order of first appearance. Empty for a series without that label. A label named |
Prometheus.Targets (Table)
Configured scrape targets with the result of their last scrape.
Data Type |
Table |
Platforms |
All ( |
| Column | Type | Description |
|---|---|---|
NAME |
String |
Target name (instance key) |
URL |
String |
Endpoint URL |
INTERVAL |
Unsigned Integer |
Scrape interval in seconds |
STATUS |
Integer |
Result of the last scrape attempt: 1 = success, 0 = failure or no attempt yet |
LAST_SCRAPE |
Unsigned Integer 64 |
Time of the last scrape attempt (UNIX time); 0 before the first attempt |
SAMPLES |
Unsigned Integer |
Number of samples kept from the last successful scrape |