For the complete documentation index, see llms.txt. This page is also available as Markdown.

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
from core_client import Client

client = Client(
    base_url="http://127.0.0.1:8080"
)
client.login()

core_metrics_collection_list = client.v3_metrics_get()
print(core_metrics_collection_list)
import (
    "fmt"
    "github.com/datarhei/core-client-go/v16"
)

client, _ := coreclient.New(coreclient.Config{
    Address: "https://127.0.0.1:8080",
})

metrics, err := client.MetricsList()

for _, m := range metrics {
    fmt.Printf("%+v\n", m)
}

Description:

List all known metrics with their description and labels

get

List all known metrics with their description and labels

Authorizations
AuthorizationstringRequired
Responses
200

OK

application/json
descriptionstringOptional
labelsstring[]Optional
namestringOptional
get/api/v3/metrics
GET /api/v3/metrics HTTP/1.1
Authorization: YOUR_API_KEY
Accept: */*
200

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:

Description:

Query the collected metrics

post

Query the collected metrics

Authorizations
AuthorizationstringRequired
Body
interval_secinteger · int64Optional
timerange_secinteger · int64Optional
Responses
200

OK

application/json
interval_secinteger · int64Optional
timerange_secinteger · int64Optional
post/api/v3/metrics
POST /api/v3/metrics HTTP/1.1
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

CPU
Memory
Disk
Filesystem
Network
FFmpeg
Restream IO
Sessions
Uptime

Last updated

Was this helpful?