DocsEngineeringLogging and search pipeline

Logging and search pipeline

Live logs, Kafka, ClickHouse, and Meilisearch.

Container output has a low-latency live path and a durable retained path.

Live path

The execution worker publishes buffered stdout and stderr to Redis-backed channels. The jobs service exposes a gRPC stream, and the HTTP gateway translates it into Server-Sent Events.

Retained path

When workflow retention is enabled, the worker also publishes deterministic log events to Kafka. The job logs processor batches records and writes them to ClickHouse, then indexes searchable fields in Meilisearch.

Replay handling

Log event IDs remain stable across retries. ClickHouse storage and analytics processing use those identifiers to avoid duplicate retained output and counts.

Query behavior

  • Plain log listing reads ClickHouse.
  • Stream-only filtering reads retained data without a text query.
  • Text search uses Meilisearch and returns safe highlight fragments.
  • Raw downloads apply the same stream and text filters without rendering markup.

Ordering and pagination

Results use descending sequence order. Cursor pagination moves toward older output and preserves filter context.

Security

Meilisearch uses HTTPS and client certificate configuration in Compose. Search highlights are treated as data and rendered without unsafe HTML injection.

Byte-bounded search submissions

The processor limits each search request to 4 MiB of encoded JSON, including metadata and escaping, independently of Kafka's count/time batch settings. HTTP 413 responses trigger further splitting; every successful indexing task must complete before the batch proceeds. Stable document IDs support safe replay when a later submission fails.

Retained-log indexing and cleanup check task status immediately, then every 250 ms while pending, with a two-minute timeout per task. Cancellation and failed tasks still stop processing. The shorter interval reduces completion delay but increases task-status requests under concurrent indexing.

An individually oversized document returns retryable ResourceExhausted; its Kafka batch remains uncommitted. Logs are neither truncated nor skipped. A server/proxy limit too small for one document requires an operator limit increase and can still block that partition until corrected. Normal log lines are limited to 256 KiB before encoding. A document exceeding the 4 MiB application budget requires inspecting its producer and correcting the source of oversized events before retrying. Rejection errors include document, workflow and job IDs for diagnosis. Do not force-commit offsets.