Skip to main content
Version: 3.2

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:

providerTypeWhere the metrics live/metrics endpointWho reads them
local (default for the binary and Docker)In memory, inside the MaestroHub processNot servedThe monitoring pages in the app
prometheusIn a Prometheus server you nameServed on the HTTP portYour 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​

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.

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"]
No authentication

/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​

MetricWhat it counts
maestrohub_pipeline_readings_shed_totalReadings a pipeline lost before it could run them, labelled by pipeline_id, stream and reason (see below).
maestrohub_engine_execution_queue_shed_totalWaiting pipeline runs dropped at the execution queue's cap: triggers that fired and never ran. One figure for the whole instance.
maestrohub_saf_loss_totalBuffered 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_totalWrites 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:

ReasonWhat happened
source_faster_than_pipelineA 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_longReadings waited longer than the queue keeps them and were dropped, oldest first.
refusedThe pipeline's queue refused the run, and every retry was refused too.
intake_heldReadings 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_backlogThe 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_floorReadings were dropped because the store's disk was at its floor, whatever the pipeline's speed.
store_fullThe run was refused because the whole message store was full (disk or memory), whatever the pipeline's speed.

Data that is waiting​

MetricWhat it tells you
maestrohub_saf_waiting_messagesMessages waiting in Store & Forward buffers for their destination.
maestrohub_saf_outages_openDestinations in an outage right now.
maestrohub_saf_engine_heartbeat_timestamp_secondsWhen the engine last finished reading its buffers. If it stops moving, nothing is counting what the buffers do.
maestrohub_engine_queue_deliveries_stranded_totalPipeline 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​

MetricWhat it tells you
maestrohub_connectors_connection_down1 while a connection is down, 0 while it is up, labelled by connection_id.
maestrohub_pipeline_executions_totalPipeline runs, labelled by pipeline_id and result.
maestrohub_pipeline_failure_streakHow 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_totalFailed 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_totalValues the Unified Namespace refused, labelled by reason (for example rate_limited).
maestrohub_storage_disk_stateThe 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