Skip to content
Support
Reference

Metrics

The OpenTelemetry metrics Hub emits from the API and worker — enrichment pipelines, webhooks, job queues, semantic search, and caches — for dashboards and alerting.

Hub emits OpenTelemetry metrics from both hub-api and hub-worker. They are exported only when a metrics exporter is configured (see OTEL_METRICS_EXPORTER); with none set, metric recording is a no-op. Standard HTTP server metrics (request duration, counts) are also emitted for the API via OpenTelemetry’s net/http instrumentation — the tables below cover Hub’s own instruments.

Label cardinality is deliberately bounded: label values come from fixed sets, and an unexpected value collapses to other rather than opening a new series.

Embeddings, translation, sentiment, and emotions each emit the same five instruments under a per-type prefix — {type} is one of embedding, translation, sentiment, emotions:

MetricTypeLabelsDescription
hub_{type}_jobs_enqueued_totalcounterJobs enqueued by the enqueue provider.
hub_{type}_provider_errors_totalcounterreasonEnqueue-path failures (for example enqueue_failed, settings_read_failed).
hub_{type}_outcomes_totalcounterstatusWorker outcomes: success, retry, failed_final, skipped.
hub_{type}_worker_errors_totalcounterreasonWorker-side errors (for example {type}_api_failed, get_record_failed, rate_limited, superseded, tenant_write_conflict).
hub_{type}_duration_secondshistogramstatusTime to process one job.

Two enrichment-wide instruments:

MetricTypeLabelsDescription
hub_provider_panics_totalcounterevent_typeRecovered panics in an event fan-out provider. Expected to stay flat; a rising value means a provider is repeatedly crashing.
hub_enrichment_outputs_cleared_totalcounteroutputEnrichment outputs (sentiment, emotions, translation) nulled by an edit’s eager-clear. A high rate with no matching re-enrichment points at backfill-recovery cases.
MetricTypeLabelsDescription
hub_hnsw_iterative_scan_degradedgauge (0/1)1 when HNSW iterative scan is latched off (pgvector < 0.8 fallback; recall capped at ef_search until restart), else 0.
MetricTypeLabelsDescription
hub_webhook_jobs_enqueued_totalcounterWebhook delivery jobs enqueued.
hub_webhook_provider_errors_totalcounterreasonEnqueue-path failures.
hub_webhook_deliveries_totalcounterstatusDelivery outcomes: success, retry, failed_final.
hub_webhook_disabled_totalcounterreasonEndpoints auto-disabled (410_gone, max_attempts).
hub_webhook_dispatch_errors_totalcounterreasonDispatch-time errors.
hub_webhook_delivery_duration_secondshistogramstatusOutbound webhook request duration.
MetricTypeLabelsDescription
hub_events_discarded_totalcounterEvents dropped because the in-memory fan-out channel was full. Should be ~0; a rise means the publisher can’t keep up.
hub_message_publisher_fan_out_duration_secondshistogramTime to fan one event out to all providers.
hub_event_channel_depthgaugeCurrent depth of the event fan-out channel.
hub_river_queue_depthgaugequeueWaiting River jobs per queue (available / retryable / scheduled).
hub_river_queue_oldest_age_secondsgaugequeueAge in seconds of the oldest waiting job per queue (0 when empty) — drives lag SLOs where depth alone cannot.
MetricTypeLabelsDescription
hub_cache_hits_totalcountercacheCache hits. cache is search_query_embedding or tenant_settings.
hub_cache_misses_totalcountercacheCache misses. Hit ratio = rate(hits) / (rate(hits) + rate(misses)) per cache.

All *_duration_seconds histograms share explicit second buckets up to 60s (…, 5, 7.5, 10, 30, 60), covering the 30s enrichment/LLM job timeouts so a final-attempt latency lands in a real bucket rather than +Inf.