graphai jobs
Sign in

Jobs Blog Observability

2 Sep 2026 · Graphai Jobs

Instance logs: ClickHouse first, Kafka only as a buffer

Every apply VM writes logs that must not disappear. The studio shows the latest 20 KB. Errors go to Sentry. Prometheus is for metrics, not log text. Kafka is optional glue — not the system of record.

jobs.graphai.eu log path GCP / AWS VMs apply-spot-N Vercel ingest /api/apply-spot · /api/logs ClickHouse inbox jobs_log_inbox durable queue (not Kafka) Instance log table jobs_instance_logs ORDER BY (instance, at) Studio log view latest 20 KB · scroll to bottom Sentry errors / exceptions only Prometheus (optional) counters · latency · not log lines Optional later: GCP Managed Kafka or Pub/Sub Use only if Vercel ingest drops under burst. ClickHouse remains the system of record. Do not query Kafka from the UI.
Solid arrows are live. Dashed is optional. ClickHouse holds every line; the UI never asks Kafka or Prometheus for log text.

What is live now

How to glue them

ClickHouse ← VMs. Direct HTTP insert is enough at our volume. The inbox table is the WAL if a second write fails.

Sentry ← errors only. Fingerprint by instance + message shape. Never send the 20 KB window as a Sentry breadcrumb dump.

Prometheus ← metrics. Scrape GCP Cloud Monitoring / node exporters: CPU, apply success rate, ingest lag. A CH query can export log_lines_total as a gauge if we add a recording rule later.

Kafka / Pub/Sub ← only under burst. If ingest 429s, put GCP Managed Kafka or Pub/Sub in front: topic key = instance id, ClickHouse ClickPipes or Kafka engine as consumer. UI still reads ClickHouse.

How not to glue them

ClickHouse vs Kafka subscribe

ClickHouse Cloud does not give the studio a Kafka-style consumer group over HTTP. It can read from Kafka if we provision a cluster. Until then the inbox MergeTree is the queue: append-only, ordered by time, never truncated by the UI.