Exporting metrics
Let your own Prometheus scrape MaestroHub, and know which counters say that data was lost, shed or is waiting.
- Format
- Prometheus text, pulled from /metrics
- Prefix
- maestrohub_
- Authentication
- None: restrict it on the network
- Default (single binary)
- Off: metrics stay in the process
Two ways MaestroHub keeps metrics
MaestroHub always counts what it does. Where those counts go is set by one key, modules.monitoring.providerType:
providerType | Where the metrics live | /metrics endpoint | Who reads them |
|---|---|---|---|
local (default for the binary and Docker) | In memory, inside the MaestroHub process | Not served | The monitoring pages in the app |
prometheus | In a Prometheus server you name | Served on the HTTP port | Your Prometheus scrapes them, and the monitoring pages read them back from it |
The setting turns on both halves together: the /metrics endpoint, and the monitoring pages reading from your Prometheus. MaestroHub refuses to start with providerType: prometheus and no prometheusUrl.
The Kubernetes single-node chart and the single-node Docker Compose bundle already run in prometheus mode with a Prometheus of their own (see Running on a single node). The steps below are for the binary and a plain Docker container.
Turn on the /metrics endpoint
- Binary
- Docker
- Kubernetes (single-node chart)
In config.yaml:
metrics:
enabled: true # the default
prometheus:
namespace: maestrohub # the default: every metric starts with maestrohub_
modules:
monitoring:
providerType: prometheus
prometheusUrl: http://prometheus.example.internal:9090
# Optional: how long that Prometheus keeps samples (its
# --storage.tsdb.retention.time). The MQTT Broker page offers its
# 7-day range only when this is 7d or more.
prometheusRetention: 15d
Then restart MaestroHub.
-e MAESTROHUB_MODULES_MONITORING_PROVIDERTYPE=prometheus \
-e MAESTROHUB_MODULES_MONITORING_PROMETHEUSURL=http://prometheus.example.internal:9090 \
-e MAESTROHUB_MODULES_MONITORING_PROMETHEUSRETENTION=15d
On by default, with a bundled Prometheus. To use your own Prometheus instead:
prometheus:
bundled:
enabled: false
url: http://prometheus.monitoring.svc:9090
externalRetention: 15d
At startup the log says Metrics provider initialized with mode=prometheus and endpoint=/metrics. With mode=manual, Prometheus mode is off.
metrics.enabled: false turns metrics off altogether: nothing is counted or served, and the monitoring pages have no metrics to show. The metrics.mode key in config.yaml is not read by the single binary; providerType decides.
Check it
curl -s http://maestrohub.example.internal:8080/metrics | grep '^maestrohub_' | head
You should see lines that start with maestrohub_. If you get the web page's HTML instead, Prometheus mode is off.
Scrape it
/metrics is served on the same port as the web UI and the API (8080 by default), at the root path.
# prometheus.yml
scrape_configs:
- job_name: maestrohub
metrics_path: /metrics
scrape_interval: 15s
static_configs:
- targets: ["maestrohub.example.internal:8080"]
/metrics answers without a login or token, on purpose, so Prometheus can scrape it. The counters describe the platform, not your data, but their labels name workspaces, pipelines and connections. Allow only your Prometheus to reach it: a firewall rule, a network policy, or a reverse proxy that serves /metrics to the Prometheus host only.
Into an OpenTelemetry backend
MaestroHub does not push metrics over OTLP. To get them into an OTLP backend (Grafana Cloud, Datadog, Elastic, or any other), let an OpenTelemetry Collector scrape /metrics with its Prometheus receiver and export from there:
# otel-collector.yaml
receivers:
prometheus:
config:
scrape_configs:
- job_name: maestrohub
scrape_interval: 15s
static_configs:
- targets: ["maestrohub.example.internal:8080"]
exporters:
otlphttp:
endpoint: https://otlp.example.com
service:
pipelines:
metrics:
receivers: [prometheus]
exporters: [otlphttp]
Metrics worth alerting on
Each name below is as Prometheus sees it, with the default maestrohub prefix. Most carry a workspace_id label.
Data that was lost or dropped
| Metric | What it counts |
|---|---|
maestrohub_pipeline_readings_shed_total | Readings a pipeline lost before it could run them, labelled by pipeline_id, stream and reason (see below). |
maestrohub_engine_execution_queue_shed_total | Waiting pipeline runs dropped at the execution queue's cap: triggers that fired and never ran. One figure for the whole instance. |
maestrohub_saf_loss_total | Buffered messages Store & Forward removed on its own, labelled by reason: capacity_eviction (the buffer pool was full) or retention_expired. Any growth is data nobody chose to lose. |
maestrohub_saf_buffer_failures_total | Writes that failed at the destination and could not be buffered, labelled by reason (for example capacity_exceeded, disk_floor, message_too_large). Depending on the reason, the write is kept in Failed messages or lost. Lost ones are also counted in the loss ledger (Lost messages on the Overview). not_kept means MaestroHub tried to keep the write and could not, so it is lost. |
reason on maestrohub_pipeline_readings_shed_total:
| Reason | What happened |
|---|---|
source_faster_than_pipeline | A queue in front of the pipeline reached its size cap and dropped its oldest readings: the pipeline runs slower than its source sends. |
waited_too_long | Readings waited longer than the queue keeps them and were dropped, oldest first. |
refused | The pipeline's queue refused the run, and every retry was refused too. |
intake_held | Readings were dropped while MaestroHub held the intake because the shared queue to the engine was backed up or the engine refused work. The cause can be another pipeline, or a stopped engine. |
pipeline_backlog | The engine's queue was full and this pipeline held far more than its share of it, so its source's newest readings were dropped to keep other pipelines moving. Only for sources that cannot be held back. |
disk_floor | Readings were dropped because the store's disk was at its floor, whatever the pipeline's speed. |
store_full | The run was refused because the whole message store was full (disk or memory), whatever the pipeline's speed. |
Data that is waiting
| Metric | What it tells you |
|---|---|
maestrohub_saf_waiting_messages | Messages waiting in Store & Forward buffers for their destination. |
maestrohub_saf_outages_open | Destinations in an outage right now. |
maestrohub_saf_engine_heartbeat_timestamp_seconds | When the engine last finished reading its buffers. If it stops moving, nothing is counting what the buffers do. |
maestrohub_engine_queue_deliveries_stranded_total | Pipeline runs that will run late, after the queue's redelivery wait. |
The full list of Store & Forward metrics, and the alert rules the Helm chart ships for them, are on Store & Forward. Disk-space metrics and an example rule are on Sizing the buffer disk.
Health of connections, pipelines and the store
| Metric | What it tells you |
|---|---|
maestrohub_connectors_connection_down | 1 while a connection is down, 0 while it is up, labelled by connection_id. |
maestrohub_pipeline_executions_total | Pipeline runs, labelled by pipeline_id and result. |
maestrohub_pipeline_failure_streak | How many runs in a row failed or completed with errors, labelled by pipeline_id. Counted per trigger: the value is the longest such run of any one trigger of the pipeline. A trigger takes its own count back to 0 with its own clean run; the value then falls to the longest count of the triggers still failing, and to 0 when none is. The Overview's failing-pipelines warning shows at 3. In Enterprise each engine process counts the runs it executed and monitoring adds the processes' values together, so with several engine replicas the value can be higher than any one trigger's streak. Before 3.1 it counted the pipeline's runs together, so any clean run cleared it. |
maestrohub_pipeline_history_collapse_overflow_total | Failed runs stored as a row of their own because their trigger already had 16 different failures collapsed in that minute, labelled by pipeline_id. The counter only grows: while it is rising, that trigger is writing one history row per failure now. A value that has stopped rising is past overflow. |
maestrohub_uns_ingress_rejected_total | Values the Unified Namespace refused, labelled by reason (for example rate_limited). |
maestrohub_storage_disk_state | The data volume: 0 enough free space, 1 approaching its floor, 2 at the floor. |
For CPU, the execution queue and the historian, see the metrics on Sizing and performance.
Example alert rules
groups:
- name: maestrohub-data-loss
rules:
- alert: MaestroHubReadingsShed
expr: sum by (workspace_id, pipeline_id) (increase(maestrohub_pipeline_readings_shed_total[10m])) > 0
labels:
severity: warning
annotations:
summary: A pipeline is losing readings before it can run them (see the reason label)
- alert: MaestroHubBufferedDataLost
expr: sum by (workspace_id, reason) (increase(maestrohub_saf_loss_total[10m])) > 0
labels:
severity: critical
annotations:
summary: Store & Forward removed buffered messages before they were delivered
- alert: MaestroHubConnectionDown
expr: max by (connection_id) (maestrohub_connectors_connection_down) == 1
for: 5m
labels:
severity: warning
annotations:
summary: A connection has been down for 5 minutes