v1

latestOpenAPI 3.0.12026-07-17221165.2 KB
OPEN METRICS AND OPEN TELEMETRY

Fetches current values and metadata

Get Metrics fetches current values and metadata for all metrics, or only metrics indicated by a comma-separated list of names.

For all numeric metrics with the given NAME prefixes, create either an Open Telemetry (JSON) or Open Metrics (text) export format giving their current value and related metadata.

The default response has plain text type, however JSON can be requested instead by setting the HTTP request Accept header to application/json. These formats can be injested by many open source monitoring tools, including Prometheus, pmdaopenmetrics(1) and pmdaopentelemetry(1).

In the Open Telemetry JSON response form, sample timestamps are always present and reported using nanosecond precision. The PCP context labels are presented once, as resource attributes, and metric labels are presented as dataPoints attributes. Unit strings conform to the Unified Code for Units of Measure specification.

$ curl -s -H Accept:application/json http://localhost:44322/metrics?names=names=disk.dev,filesys | pmjson

In the Open Metrics (Prometheus) text response form, the native PCP metric metadata (metric name, type, indom, semantics and units) is first output for each metric with # PCP prefix. The metadata reported is of the form described on pmTypeStr(3), pmInDomStr(3), pmSemStr(3) and pmUnitsStr(3) respectively. If the pmUnitsStr(3) units string is empty, then none is output. The units metadata string may contain spaces and extends to the end of the line.

  $ curl -s http://localhost:44322/metrics?names=proc.nprocs,kernel.pernode.cpu.intr,filesys.blocksize

PCP metric names are mapped so that the . separators are exchanged with _ (':' in back-compatibility mode, where "# PCP" is the identifying line suffix). Both metric labels and instances are represented as Open Metrics labels, with external instance names being quoted and the flattened PCP label hierarchy being presented with each value.

get/metrics

Query parameters

namesstring

Comma-separated list of metric names

filterstring

Comma-separated list of filters

matchstring

Pattern matching style (exact, glob or regex)

timesboolean

Append sample times (milliseconds since epoch), only relevent for the text response form as JSON response form includes times (nanoseconds since epoch) by default.

Response

OK

All 22 operations