Skip to main content
Metrics, logs and the audit log stay on the control plane and its nodes by default. Data export sends copies to the tools you already run: Grafana and Prometheus, Loki, a syslog server, a SIEM webhook, an S3 compatible bucket, or an OpenTelemetry collector. Nothing is exported until you add a destination, and a destination that is down never slows a container, a deploy or the API.

What you can export

Manage destinations from Settings, Data export in the dashboard or with levelrail-cli export destinations.

Prometheus scrape

GET /metrics returns the Prometheus text format. It is gated like every read route: give Prometheus a token with the read ability as a bearer credential.
Cardinality is bounded. The only labels are app, database and node (one per series, from the resource the sample belongs to) and destination on the exporter’s own series, so the series count tracks what you have deployed and what you configured, not request traffic. The prefix is the lowercase brand short name followed by an underscore, levelrail_ on a stock install. A token limited to some apps only sees those apps and databases, and no node or platform series.

Loki and Grafana quick start

  1. Run Loki and Grafana wherever you like. For a trial on one host:
  2. Loki on the same host or a private network is an internal address, which export refuses by default. On the control plane set APP_EXPORT_ALLOW_PRIVATE_NETWORKS=true and restart (see Environment variables). A public HTTPS Loki needs nothing.
  3. Add the destination:
    For Grafana Cloud or a multi-tenant Loki add --header X-Scope-OrgID=tenant or --header "Authorization=Basic <base64>". Header values are stored encrypted and are never returned by the API.
  4. In Grafana add a Loki data source pointing at http://loki:3100, then query {job="levelrail", app="web"}.
Loki streams carry the labels job, app, kind (app or database), stream (stdout or stderr) and level, plus any --label you set. level is the structured level or severity field when the line is JSON, otherwise error for stderr and info for stdout.

Log destinations

Filters apply per destination: --app (repeatable, empty means every app) and --min-level (debug, info, warn, error). Database containers are exported only by destinations with no --app filter.
  • HTTP JSON lines: one JSON object per line: time, kind, app, stream, level, message and fields for structured lines. Content-Type: application/x-ndjson.
  • Loki: an endpoint with no path gets /loki/api/v1/push appended.
  • Syslog: tcp://host:port or tls://host:port, RFC 5424 with octet counting framing, facility local0. TLS verifies the server certificate against the system roots.
Log export reuses the log stream the live tail already reads: it adds a subscriber, never a second Docker reader.

Vendor destinations

Four vendors have a destination kind of their own, so you paste a key and pick a region instead of working out an endpoint and a header. They use the same queue, retries, circuit breaker, filters, status and test as every other log destination. The key is stored encrypted like any export header and never returned; a destination shows has_api_key instead. An explicit --endpoint overrides the preset, for a proxy or a regional host. Changing region, site or dataset on a preset destination moves its endpoint with it.
Each line is sent with the app name as the service, its stream and its level. For structured lines the parsed fields are included (New Relic as fields, Axiom flattened into the record).

Audit log export

Streaming sends each new audit row at least once. Each batch is NDJSON, and webhook batches carry these headers (the prefix follows the brand name): The signature is HMAC-SHA256 over <unix>.<raw body> with your key. Verify it and reject timestamps outside a few minutes:
audit_s3 writes each batch to <prefix>/<yyyy>/<mm>/<dd>/<first-created-at>-<first-id>.ndjson in a storage destination. The key is derived from the batch’s first row, so a retried batch overwrites itself. Tokens, bearer values, URL credentials and token-shaped strings are masked in every exported field. By default streaming starts at the moment the destination is created. --backfill starts at the oldest audit row instead.

Splunk, syslog and OpenTelemetry sinks

Three streaming sinks feed a SIEM directly. All three use the same cursor, retry and breaker as the webhook, and all three send the same fields, listed in Audit event schema.
  • Splunk. Each row is one HEC event with time, host, source, sourcetype, index and the record as event. The token is sent as Authorization: Splunk <token> and is never returned by the API or written to an event.
  • Syslog. Messages are RFC 5424. TCP and TLS use octet counting. Actor, ability, method, path, status, remote address and surface are in the audit@32473 structured data element. UDP carries one message per datagram and is cut at 1400 bytes, so prefer TCP or TLS for a log that must be complete. A TCP write that succeeds only means the kernel took it, so a collector that drops data after accepting it can still lose rows. Splunk and OTLP confirm each batch with an HTTP response.
  • OpenTelemetry. JSON encoded ExportLogsServiceRequest. service.name is the product short name, so it follows the brand. Severity is ERROR for 5xx, WARN for 4xx and INFO otherwise.
  • TLS. Certificates are verified. --insecure-skip-verify (or the switch in the dashboard, which warns) turns verification off for one destination, for a collector you control with a self-signed certificate.
  • Private collectors. An internal Splunk or syslog host is refused unless APP_EXPORT_ALLOW_PRIVATE_NETWORKS=true. Cloud metadata and link-local addresses (169.254.0.0/16, fe80::/10, and similar) are refused even then, at save time and at every connection.
  • Test. Send test (or levelrail-cli export destinations test <id>) delivers one synthetic event. A failure comes back with a typed fix: replace the token, accept a certificate, check reachability, check the index or path, or allow private networks. In the dashboard the fix is a button that applies the change and tests again.
  • Falling behind. There is no in-memory queue for audit sinks: the audit log is the buffer, so a failing sink never drops a row, and its cursor stays on the last accepted batch. Create an alert rule of kind export_behind to be told when a destination keeps failing (default 15 minutes, set with --for-duration).

Delivery semantics

  • A cursor (timestamp and row id) is saved after every successful batch, so a restart resumes where it stopped.
  • Delivery is at least once. A crash between a receiver accepting a batch and the cursor being saved sends that batch again, with the same id range.
  • A failing destination holds the cursor and retries. Rows are never skipped, and the audit log itself is the buffer.

On demand download

from is inclusive and to exclusive. The API route is GET /api/v1/audit-log/export?from=&to=&format=ndjson|csv and needs the root ability. A single download is capped at APP_EXPORT_AUDIT_MAX_ROWS.

OTLP metrics

A metrics_otlp destination pushes the same series as the scrape endpoint as OTLP/HTTP JSON (/v1/metrics is appended when the endpoint has no path). Counters are cumulative monotonic sums, everything else gauges. The interval defaults to APP_EXPORT_METRICS_INTERVAL and can be set per destination with --interval (10 to 3600 seconds).
A metrics_otlp destination also accepts --app (repeatable) to export only those apps’ container series. Platform series are always included.

Prometheus remote write

A metrics_remote_write destination pushes the same series as the scrape endpoint using Prometheus remote write 1.0 (snappy compressed protobuf), so Grafana Cloud, Mimir, VictoriaMetrics and Prometheus started with --web.enable-remote-write-receiver can ingest it. The endpoint is used as given, because the path differs per receiver (for example /api/v1/write, /api/v1/push, /api/prom/push). Series names and labels match the scrape endpoint, and the interval works like metrics_otlp. Pass --username with --api-key-env for basic auth (Grafana Cloud uses the instance id and an access policy token). Without a username the key is sent as a bearer token. --header can set any other auth header. Secrets are stored encrypted and never returned. --app limits the container series to those apps.

Platform self metrics

Besides per-app container metrics, the scrape endpoint and every metrics_otlp destination carry a fixed set of control plane gauges (prefix is the brand short name, levelrail_ on a stock install). Restricted tokens never see them.

OTLP logs

A logs_otlp destination pushes container log lines as OTLP/HTTP JSON (/v1/logs is appended when the endpoint has no path). Each app is one resource with service.name set to the app name, kind, and your --label pairs as resource attributes. Records carry the severity, the stream and, for JSON lines, the parsed fields. --app and --min-level filter as for the other log kinds.
levelrail-cli otel destinations is a signal-first view of the same destinations: add --signal metrics|logs creates a metrics_otlp or logs_otlp kind, and remove deletes one. Delivery state (last success, last error, queue depth, dropped) is the same as for every other destination, in Settings, Data export.

Reliability and safety

  • Every log destination has a queue of APP_EXPORT_QUEUE_LINES entries. When it fills, the oldest entries are dropped and counted.
  • The queue is mirrored on disk under APP_EXPORT_SPOOL_DIR (default <data dir>/export-spool), so lines a down receiver has not accepted survive a control plane restart and are sent after it. A batch that fails after its retries stays queued and is tried again, instead of being dropped. A crash between a send and its record of success can deliver that batch twice, so delivery is at least once. Set APP_EXPORT_SPOOL=false to keep the backlog in memory only. Audit rows never needed this: they are read from the audit log by cursor.
  • Container log lines are handed to exporters through a non-blocking subscription. A slow destination cannot slow a container, the log store, a deploy or the API.
  • A batch is retried with exponential backoff and jitter up to APP_EXPORT_MAX_ATTEMPTS times. Responses in the 4xx range other than 408 and 429 are not retried, because retrying cannot fix them.
  • After APP_EXPORT_BREAKER_FAILURES consecutive failed batches a destination backs off for APP_EXPORT_BREAKER_COOLDOWN, then tries one batch.
  • Endpoints are validated when saved and again at every connection, including redirects: private and loopback addresses are refused unless APP_EXPORT_ALLOW_PRIVATE_NETWORKS=true. Cloud metadata and link-local addresses are always refused. Endpoints cannot embed credentials.
  • Headers and signing keys are stored with envelope encryption and are never returned. The API shows header names and whether a key is set.
  • Each destination shows its last success, last error, queue depth, dropped and failed counts, and breaker state, in the dashboard, with levelrail-cli export destinations status <id>, and as export_* metrics.

CLI

--header and --hmac-key values end up in your shell history. Prefer a script that reads them from a secret store.

Next steps

Observability

Node-local metrics and the remote read endpoint.

Log archive

Scheduled, compressed log archives in a bucket.
Last modified on October 20, 2026