--- checkId: check.observability.metrics plugin: stellaops.doctor.observability severity: warn tags: [observability, metrics, prometheus] --- # Metrics Collection ## What It Checks Inspects `Metrics:*`, `Prometheus:*`, and `OpenTelemetry:Metrics:*` settings. When a metrics port is configured and an `IHttpClientFactory` is available, the check probes `http://localhost:`. The check returns info when metrics are disabled or absent, and warns when the configured endpoint cannot be reached. ## Why It Matters Metrics are the primary input for alerting, SLO tracking, and capacity planning. Missing or unreachable endpoints remove the fastest signal operators have. ## Common Causes - Metrics were never enabled in the deployment configuration - The metrics path or port does not match the listener exposed by the service - A sidecar or reverse proxy blocks local probing ## How to Fix ### Docker Compose ```yaml services: doctor-web: environment: Metrics__Enabled: "true" Metrics__Path: /metrics Metrics__Port: 8080 ``` Probe the endpoint from inside the container: ```bash docker compose -f devops/compose/docker-compose.stella-ops.yml exec doctor-web curl -fsS http://localhost:8080/metrics ``` ### Bare Metal / systemd Bind the metrics port explicitly if the service does not share the main HTTP listener. ### Kubernetes / Helm Align the `ServiceMonitor` or Prometheus scrape config with the same path and port the app exposes. ## Verification ```bash stella doctor --check check.observability.metrics ``` ## Related Checks - `check.observability.otel` - OpenTelemetry metrics often share the same collector path - `check.observability.alerting` - metrics are usually the source for alert rules