---
title: "Fetches current values and metadata"
method: GET
path: "/metrics"
tags: ["OPEN METRICS AND OPEN TELEMETRY"]
---

# Fetches current values and metadata

`GET /metrics`

`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](https://man7.org/linux/man-pages/man1/pmdaopenmetrics.1.html)(1) and
[pmdaopentelemetry](https://man7.org/linux/man-pages/man1/pmdaopentelemetry.1.html)(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](https://ucum.org/) specification.
```bash
$ 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](https://man7.org/linux/man-pages/man3/pmtypestr.3.html)(3), [pmInDomStr](https://man7.org/linux/man-pages/man3/pmindomstr.3.html)(3), 
[pmSemStr](https://man7.org/linux/man-pages/man3/pmsemstr.3.html)(3) and [pmUnitsStr](https://man7.org/linux/man-pages/man3/pmunitsstr.3.html)(3) respectively.  If the [pmUnitsStr](https://man7.org/linux/man-pages/man3/pmunitsstr.3.html)(3) units string is empty, then **none** is output.  The units metadata string may contain spaces and extends to the end of the line.
```bash
  $ 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.

## Query parameters

- `names` string
- `filter` string
- `match` string
- `times` boolean

## Response `200`

OK

## Changes

- **2026-07-17** `666212c8ed6b` — 1 info
  - added the success response with the status `200`
- **2025-09-19** `f77e31f4001e` — 5 info
  - api operation id `get/metrics` was added
  - added the new optional `query` request parameter `filter`
  - added the new optional `query` request parameter `match`
  - added the new optional `query` request parameter `names`
  - …1 more
- **2025-09-18** `5637b11d8354` — 4 warning
  - deleted the `query` request parameter `filter`
  - deleted the `query` request parameter `match`
  - deleted the `query` request parameter `names`
  - deleted the `query` request parameter `times`
- **2025-07-28** `dd88e57471de` — 2 info
  - api tag `OPEN METRICS AND OPEN TELEMETRY` added
  - api tag `OPEN METRICS` removed
- **2025-03-13** `4ce83bc5e1e6` — 2 info
  - added the new optional `query` request parameter `filter`
  - added the new optional `query` request parameter `match`

[Full history](https://skmtc.dev/performancecopilot/apis/pmwebapi/changes/metrics/get.md)

---

[API](https://skmtc.dev/performancecopilot/apis/pmwebapi.md) · [All operations](https://skmtc.dev/performancecopilot/apis/pmwebapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/performancecopilot/pmwebapi/revisions/666212c8ed6b/schema)
