ODOCK.AI
ObservabilityLGTM Stack

Logs

Structured logger output, correlation, and the logger pipeline.

Logs

Logs are the textual evidence layer of the LGTM stack. They are most useful when you already know the request id, trace id, provider, plugin, or time window you need to investigate.

odock-server writes structured JSON logs to stdout. Promtail tails container stdout and forwards the records to Loki.

"Logs on grafana"

Why Stdout Plus Promtail Is The Default

The default production strategy is:

  • traces and metrics via OpenTelemetry
  • logs via logger.OrganisationLogger
  • correlation via shared context fields and trace_id / span_id
  • structured JSON as the canonical log format

This keeps the gateway on one logging path and avoids a second production log pipeline for the same records.

Correlation Fields

During a traced request, log records can include:

FieldMeaning
trace_id, span_idOpenTelemetry trace correlation
request_idGateway request id, same as X-Request-Id
organization_idOwning organisation
provider, model, route, endpointRouted target attributes
moduleActive subsystem
plugin_chain, plugin_name, plugin_stagePlugin pipeline coordinates
security_moduleActive safety module
ratelimit_stage, ratelimit_moduleRate-limit position
decisionStable per-phase decision label

What Is Never Logged

The gateway observability layer does not emit:

  • prompt or completion bodies
  • API keys, auth headers, or raw provider credentials
  • decoded request payloads

That keeps LGTM suitable for operational investigation without turning it into a content store.

Logger Pipeline Health

The log pipeline exports its own health metrics:

MetricPurpose
gateway.logs.enqueued.totalRecords accepted into the in-process queue
gateway.logs.dropped.totalRecords dropped because the queue was full
gateway.logs.write_errors.totalBackend write errors
gateway.logs.batch_sizeHistogram of batch sizes
gateway.logs.queue_depthCurrent queue depth
gateway.logs.flush_durationHistogram of flush durations

These metrics back the Logger Health dashboard and the log pipeline alerts. See Grafana dashboards and Alerts.

Optional File And S3 Archives

If your deployment needs archive paths outside Loki:

  • set LOGGER_OUTPUT=stdout,file
  • make ODOCK_SERVER_LOGS_PATH writable by the container user
  • extend the examples under docs/observability for file rotation or S3-compatible archives

These paths supplement stdout shipping. They do not replace it.

Tips

Filter Loki by structured fields such as request_id, provider, or plugin_name instead of broad free-text search.

If you fork the gateway and enable OTEL logs for odock-server, disable the stdout plus Promtail path for that service or you will duplicate log records.

On this page