Skip to content

Observability (OpenTelemetry, Prometheus, health checks) #31

Description

@andreahlert

Problem

The current logging system is basic (structured stderr output). Production deployments need metrics, traces, and detailed health checks.

Proposal

Prometheus metrics endpoint

GET /metrics

Exports:

  • kilnx_http_requests_total{method, path, status}
  • kilnx_http_request_duration_seconds{method, path}
  • kilnx_db_queries_total{type} (select, insert, update, delete)
  • kilnx_db_query_duration_seconds
  • kilnx_sessions_active
  • kilnx_jobs_total{status} (pending, completed, failed)

Enhanced health check

GET /healthz
{
  "status": "ok",
  "uptime": "2h34m",
  "database": "ok",
  "sessions": 42,
  "version": "1.5.0"
}

OpenTelemetry traces (optional)

config
  telemetry: env OTEL_ENDPOINT
  • HTTP request spans
  • SQL query spans
  • Email/job spans

Config

log
  level: info
  queries: slow > 100ms
  requests: all
  metrics: /metrics
  telemetry: env OTEL_EXPORTER_OTLP_ENDPOINT

Why

Production visibility. Developers need to know what their app is doing without adding external APM tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions