Metrics
OpenTremor Core exposes a /metrics endpoint in Prometheus format. Prometheus can scrape it without authentication. The OpenTremor Monitoring repository provides a separate Grafana dashboard.
Scrape metrics
Section titled “Scrape metrics”Configure Prometheus to scrape the Core server:
scrape_configs: - job_name: opentremor-core static_configs: - targets: - <host>:8000 metrics_path: /metricsThe endpoint is served by prometheus_client and is excluded from HTTP request timing. The prometheus-client dependency is included by default.
Metric catalogue
Section titled “Metric catalogue”Every metric below carries an org_id label, so you can filter any panel or query by tenant. See Filter by organization.
HTTP request metric
Section titled “HTTP request metric”| Metric | Type | Labels | Description |
|---|---|---|---|
http_request_duration_seconds | Histogram | method, handler, status, org_id | HTTP request latency. The handler label uses the route template, not the raw path. Requests matching no route use none. Requests to /metrics and paths beginning with /health are excluded. |
Analysis metrics
Section titled “Analysis metrics”| Metric | Type | Labels | Description |
|---|---|---|---|
mcp_ingest_total | Counter | pack, org_id | Plan ingest calls |
mcp_ingested_resources_total | Counter | pack, org_id | Resources ingested |
mcp_analysis_total | Counter | resource_type, org_id | Analysis submissions |
mcp_findings_total | Counter | resource_type, severity, org_id | Individual findings — severity is CRITICAL, HIGH, MEDIUM, LOW, or INFO |
mcp_llm_analysis_duration_seconds | Histogram | resource_type, org_id | Time from a unit’s claim (POST /v1/{changeset}/claims) to its analysis submission (POST /v1/{changeset}/analyses) |
mcp_analysis_total and mcp_findings_total count identically regardless of how the analysis was produced: client-led PUT, server-side POST .../analyze, or a GitHub-webhook-triggered run. All three use the same analysis_service.record_analysis(). Prometheus metrics do not report billing (usage_events/LLM token cost) or finding triage changes. For billing, query GET /v1/orgs/{org_id}/usage. For finding summaries, query GET /v1/findings/summary.
Filter by organization
Section titled “Filter by organization”The org_id label comes from the same request-scoped context as telemetry spans (current_principal() in the platform’s controllers/shared/observability/request_context.py). Metrics need no separate plumbing. Requests without a resolved org, such as health checks, the metrics scrape, public report links, GitHub webhooks, and SSO callbacks before login, use org_id="_none" instead of an empty label value. The label is always an explicit, queryable string.
# Request rate for one org onlysum(rate(http_request_duration_seconds_count{org_id="7c3c6e2e-..."}[5m]))
# Findings by severity for one orgsum(rate(mcp_findings_total[5m])) by (org_id, severity)