Metrics
Query the collected metrics.
The core can collect metrics about itself, the system it is running on, and about the FFmpeg processes it is executing. This is not enabled by default. Please check the metrics configuration for how to enable it and how often metrics should be collected and for how long metrics should be kept available for querying.
Each metric is collected by a collector, like a topic. Each collector can contain several metrics and each metric can have labels to describe a variant of that metric. Think of used space on a filesystem where the variant is whether it is a disk filesystem or a memory filesystem.
All metrics can be scraped by Prometheus from the /metrics
endpoint, if enabled.
List collectors
In order to know which metrics are available and to learn what they mean, you can retrieve a list of all metrics, their descriptions and labels.
Example:
curl http://127.0.0.1:8080/api/v3/metrics \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-X GET
Description:
List all known metrics with their description and labels
GET /v3/metrics HTTP/1.1
Host: api
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"description": "text",
"labels": [
"text"
],
"name": "text"
}
]
Query metrics
All collected metrics can be queried by sending a query to the /api/v3/metrics
endpoint. This query contains the names of the metrics with the labels you are interested in. Leave out the labels in order to get the values for all labels of that metrics. By default you will receive the last collected value. You can also receive a whole timeseries for each metric and label by providing a timerange and stepsize in seconds.
Example:
curl http://127.0.0.1:8080/api/v3/metrics/ \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"metrics": [
{
"name": "cpu_idle"
}, {
"name": "mem_free"
}
]
}'
Description:
Query the collected metrics
POST /v3/metrics HTTP/1.1
Host: api
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 108
{
"interval_sec": 1,
"metrics": [
{
"labels": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"name": "text"
}
],
"timerange_sec": 1
}
{
"interval_sec": 1,
"metrics": [
{
"labels": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"name": "text",
"values": [
{
"ts": "text",
"value": 1
}
]
}
],
"timerange_sec": 1
}
Available collectors
Last updated
Was this helpful?