Skip to content

[FEATURE] Expose Prometheus /metrics for the agent itself (incidents, queue, tools, approvals, tokens) #125

Closed

Description

@OkiriGabriel

Feature

prometheus-client is already in requirements.txt, but the API exposes no /metrics endpoint. Operators can't monitor or alert on the agent itself, which matters for an on-call tool.

Proposed metrics

Metric Type Labels
devops_agent_incidents_total counter org, type, source, outcome (resolved/unresolved/failed)
devops_agent_queue_depth gauge org, state (pending/processing)
devops_agent_incident_duration_seconds histogram type
devops_agent_tool_calls_total counter tool, result (ok/error/blocked/requires_approval)
devops_agent_approvals_total counter outcome (requested/approved/rejected/expired)
devops_agent_llm_tokens_total counter model, kind (input/output)
devops_agent_fix_verification_total counter status (verified/failed/unstable)
devops_agent_webhook_requests_total counter endpoint, status
devops_agent_emergency_stop gauge

Notes

  • /metrics should be optionally token-protected (METRICS_TOKEN), or bound on a separate port.
  • Keep label cardinality low: no incident IDs, repos or hostnames.
  • Ship an example Grafana dashboard and alert rules (queue stuck, error rate, emergency stop on), plus docs in docs/GRAFANA_PROMETHEUS.md.

Activity

  1. added
    enhancement
    on Oct 24, 2026
  2. OkiriGabriel commented on Nov 3, 2026

    @OkiriGabriel
    CollaboratorAuthor

    Picking this up. Plan:

    • GET /metrics in Prometheus format, protected by METRICS_TOKEN when set.
    • Metrics: incidents processed (by type, source and outcome), queue depth, incident duration, tool calls (by tool and result: ok, error, blocked, requires_approval), Slack approval decisions, fix-verification results, webhook requests (by endpoint and status), and an emergency-stop gauge.
    • Low-cardinality labels only (no incident IDs, repos or hosts), plus docs in docs/GRAFANA_PROMETHEUS.md with a scrape config and example alert rules.

    PR to follow.

  3. self-assigned this
    on Nov 3, 2026
  4. added a commit that references this issue on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions