Logs Extension

The logs extension surfaces Loki log data inside ArgoCD. Developers can search historical logs, filter by severity, and view log volume charts without leaving ArgoCD.

Registration

The extension registers as:

  • Resource tabs on Pod, Deployment, and StatefulSet resources
  • App view on any ArgoCD Application (Log Explorer)

What it shows

Resource tabs

Per-resource log views:

  • Historical log lines from Loki
  • Severity detection (error, warn, info, debug) with color coding
  • Time range picker (15m, 1h, 6h, 24h, custom)
  • Free-text search filter
  • Container selector (for multi-container pods)
  • Label-based filtering

Application view (Log Explorer)

Cross-pod log aggregation for the entire application:

  • All logs from pods in the application’s namespace
  • Volume chart showing log rate over time
  • Severity filter buttons
  • Search across all containers

Live tail

The logs extension does not support live tail. ArgoCD’s built-in Logs tab handles real-time pod streaming via the Kubernetes API. Loki’s tail API uses WebSocket, which ArgoCD’s proxy extension mechanism does not support.

Severity detection

The backend automatically detects log severity from line content:

  • JSON structured logs: "level": "error", "severity": "warn"
  • Key-value format (slog, logfmt): level=error, level=warn
  • Bracket format: [ERROR], [WARN], [INFO], [DEBUG]
  • Fallback: lines without severity markers default to info

The severity filter uses the same rules, so filtering for error shows exactly the lines marked as errors. A JSON line with "level":"info" whose message mentions an error stays info.

Backend

The logs backend queries Loki:

EndpointDescription
GET /api/v1/logsQuery log entries with filters
GET /api/v1/logs/labelsDiscover available log labels
GET /api/v1/logs/label/{name}/valuesGet values for a specific label
GET /api/v1/logs/volumeGet log volume over time (for charts)

Configuration

Environment VariableRequiredDefaultDescription
LOKI_URLNohttp://loki.monitoring.svc:3100Loki instance URL
LOKI_TENANT_IDNo(empty)Loki tenant ID for multi-tenant mode
PORTNo8083HTTP server port
LOG_LEVELNoinfoLog level
CLUSTER_LABELNo(empty)Loki stream label that identifies the cluster, e.g. cluster. Empty disables the cluster filter.
CLUSTER_MAPNo(empty)JSON object mapping ArgoCD cluster names or server URLs to label values

With a Loki shared by several clusters, CLUSTER_LABEL scopes log queries and label discovery to the Application’s destination cluster. Resolution and CLUSTER_MAP work as described under “Cluster filter” on the metrics extension page. The label must be a stream label; structured metadata is not matched.

RBAC

p, role:developer, extensions, invoke, logs, allow