Skip to content

Prometheus Metrics

Zammad-AI exposes Prometheus metrics for the backend API, triage flow, answer generation, and Kafka processing. These metrics are intended for local observability during development and for dashboards such as Grafana.

Metrics Endpoint

The application exports metrics on the standard Prometheus /metrics endpoint.

The metrics server is started during application startup when prometheus.enabled is set to true.

The port is configured via settings but default to 9090.

Exported Metrics

HTTP Metrics

Collected by the FastAPI middleware in the backend service:

  • zammad_ai_http_requests_total
  • zammad_ai_http_request_duration_seconds

These metrics are labeled by HTTP method, resolved route path, and status code.

Triage Metrics

Collected while the triage service processes tickets:

  • zammad_ai_triage_run_duration_seconds
  • zammad_ai_triage_runs_in_progress

Answer Metrics

Collected while the answer service generates responses:

  • zammad_ai_answer_run_duration_seconds
  • zammad_ai_answer_runs_in_progress

Kafka Metrics

Kafka processing metrics use the zammad_ai_kafka_* prefix and are emitted by the Kafka middleware layer.

Configuration

Prometheus is configured in config.yaml under the prometheus section:

yaml
prometheus:
  enabled: true
  port: 9090

Environment variables use the ZAMMAD_AI_PROMETHEUS__ prefix.

Local Development

The local compose stack includes a Prometheus container and a Grafana container.

  • Prometheus scrapes host.docker.internal:9090 every 15 seconds.
  • Grafana is available on port 3000.
  • Prometheus persistence is stored in the prometheus_data volume.