Observability in Charmed Authentik¶
Charmed Authentik provides comprehensive integration with the Canonical Observability Stack (COS) across all three operators (authentik-server, authentik-worker, and authentik-ldap-outpost).
This reference details the metrics, Prometheus alert rules, Loki log alert rules, Grafana dashboards, and OpenTelemetry tracing endpoints provided by the charms.
Integration endpoints¶
All three Authentik operator charms provide identical integration endpoint names for observability:
Endpoint |
Role |
Interface |
Description |
|---|---|---|---|
|
Provider |
|
Exposes Prometheus scrape metrics on port 9300 at the default |
|
Provider |
|
Forwards charm-specific, built-in Grafana dashboards to Grafana. |
|
Requirer |
|
Ships container and service logs to Loki. |
|
Requirer |
|
Streams distributed tracing spans to Tempo using the OTLP/HTTP protocol (limit: 1 relation). |
Note
All four observability integrations are optional. Tracing environment variable injection differs across components:
authentik-serverandauthentik-workerinjectOTEL_EXPORTER_OTLP_ENDPOINT.authentik-ldap-outpostinjectsAUTHENTIK_OUTPOST__DISCOVER__OTLP_TRACES_ENDPOINT.
Prometheus alert rules¶
The Charmed Authentik suite defines nine charm-specific Prometheus alert rules across six rule files:
Alert Name |
Charm |
Trigger Condition |
Duration |
Severity |
Impact |
|---|---|---|---|---|---|
|
Server |
Ratio of |
5m |
|
More than 30% of Authentik server units are unreachable. |
|
Server |
Sum of |
5m |
|
All Authentik server units are down; total loss of authentication and API access. |
|
Server |
5xx responses > 5% of total HTTP requests |
10m |
|
Web or API requests are failing due to internal server errors. |
|
Worker |
Ratio of |
5m |
|
More than 30% of Authentik worker units are unreachable. |
|
Worker |
Sum of |
5m |
|
All worker units are down; background tasks and directory syncs are halted. |
|
Worker |
De-duplicated |
15m |
|
Tasks are accumulating in the queue and worker capacity may be saturated. |
|
Outpost |
Ratio of |
5m |
|
More than 30% of LDAP Outpost units are unreachable. |
|
Outpost |
Sum of |
5m |
|
All LDAP Outpost units are down; LDAP authentication is unavailable. |
|
Outpost |
|
5m |
|
The outpost lost its WebSocket connection to the server; policy evaluation and configuration sync will fail. |
Note
Each charm also includes the generic application alert group appended automatically by the prometheus_scrape charm library.
Loki log alert rules¶
All three operator charms include an identical Loki log alert rule:
Rule Name:
HighFrequencyHighSeverityLogData Source: Loki
Query Expression: Counts log entries with severity
error,fatal, orcriticalwithin a 5-minute sliding window across JSON-structured logs (tolerating non-JSON lines via__error__ != "JSONParserErr").Threshold & Duration: Fires when the count exceeds 100 lines in 5 minutes (no
forduration clause).Severity:
errorDescription: Alerts administrators when an application unit experiences an unusually high volume of high-severity error logs, indicating misconfiguration, unhandled exceptions, or crash loops.
Grafana dashboards¶
Each charm exports a dedicated, pre-configured Grafana dashboard tagged with authentik and identity platform. The dashboards include template variables for Juju topology filtering (juju_model, juju_application, juju_unit) and data source selectors (prometheusds, lokids):
Charmed Authentik Server Operator Dashboard (
authentik-server-dashboard)Availability: Fractional unit availability gauge and list of available units.
Logging: High-severity log entries time series (error, fatal, critical) grouped by level.
HTTP: Response rate by HTTP status code and 90th percentile request latency by Django view.
Flows & Policies: 90th percentile flow plan duration by flow slug, 90th percentile stage execution duration by stage type, and 90th percentile policy engine evaluation duration by object type.
Platform: Connected task workers (by version and match state), connected outposts, and queued background tasks.
Charmed Authentik Worker Operator Dashboard (
authentik-worker-dashboard)Availability: Fractional unit availability gauge and list of available units.
Logging: High-severity log entries time series (error, fatal, critical) grouped by level.
Background Tasks: Queued tasks by actor, task completion throughput by actor, and connected task workers.
Task Performance: 90th percentile task execution duration by actor, and 90th percentile policy binding execution duration by binding target type.
Charmed Authentik LDAP Outpost Operator Dashboard (
authentik-ldap-outpost-dashboard)Availability: Fractional unit availability gauge and list of available units.
Logging: High-severity log entries time series (error, fatal, critical) grouped by level.
LDAP: Request rate by operation type, 90th percentile request duration by operation type, rejected requests by reason, and WebSocket connection state to the Authentik server (
authentik_outpost_connection).
Metric inventory¶
The following Prometheus metrics are scraped from the Authentik workload on port 9300:
Metric Name |
Component |
Description & Key Labels |
|---|---|---|
|
All |
Standard Prometheus reachability metric (1 = available, 0 = unreachable). |
|
Server |
Total HTTP responses partitioned by |
|
Server |
HTTP request latency histogram partitioned by Django |
|
Server |
Histogram of the time taken to plan an execution flow, partitioned by |
|
Server |
Duration histogram of individual flow stages, partitioned by |
|
Server |
Execution time histogram for the policy engine partitioned by target |
|
Worker |
Policy binding execution latency partitioned by |
|
Server |
Gauge showing active connected outposts partitioned by |
|
Server, Worker |
Number of active background workers, labeled with |
|
Server, Worker |
Number of pending tasks in background queues, labeled by |
|
Worker |
Counter of executed tasks partitioned by |
|
Worker |
Histogram of task execution times partitioned by |
|
Outpost |
Latency and invocation counts of LDAP requests partitioned by operation |
|
Outpost |
Counter of rejected LDAP requests partitioned by |
|
Outpost |
Binary gauge (1 = connected, 0 = disconnected) reflecting the WebSocket link from the outpost to the Authentik server. |
Important
Metric aggregation guidelines:
Task queue de-duplication:
authentik_tasks_queuedis emitted by both the server and worker instances. Always aggregate withmax by (queue_name, actor_name)before summing across the model to avoid double-counting.Version skew detection: Monitor
authentik_tasks_workers{version_matched="false"}to identify mismatched worker versions following an upgrade.Outpost connectivity: Alert on
authentik_outpost_connection == 0. If the outpost loses its WebSocket channel, it cannot synchronize directory configuration or execute non-cached authentication flows.