Table & column reference

The SQL Editor and Builder run against ClickHouse. The database is `observekit` — the editor defaults to it, so you can write FROM logs (unqualified) instead of FROM observekit.logs.

> Two gotchas up front. Durations are stored in nanoseconds (duration_ns), not milliseconds — divide by 1e6 for ms. The source column is `source_id`, not source. attributes / labels / parsed_fields are JSON strings — extract with JSONExtractString(col, 'key').

logs

Every log line (agent- or OTLP-collected).

ColumnTypeNotes
timestampDateTime64(9, UTC)Nanosecond precision, UTC
source_idStringThe source the line belongs to
namespaceStringK8s namespace (empty for non-k8s)
pod_nameString
container_nameString
container_idString
node_nameString
streamStringstdout / stderr
levelStringdebug, info, warn, error, trace, unknown (unparseable)
messageStringThe log body
labelsString (JSON)Pod labels / OTLP attributes
parsed_fieldsString (JSON)Structured fields parsed from the line
trace_idStringLinks to a span (if correlated)
span_idString
exception_fingerprintStringGroups repeated stack traces (see Exceptions)
workloadStringDeployment/StatefulSet/DaemonSet name
workload_kindStringe.g. Deployment

Ordered by (source_id, timestamp).

spans

Trace spans from OTLP.

ColumnTypeNotes
trace_idStringOne trace = many spans
span_idString
parent_span_idStringEmpty for the root span
nameStringOperation name, e.g. GET /checkout
service_nameStringFrom the OTLP service.name attribute
kindStringserver, client, internal, …
start_timeDateTime64(9, UTC)Use this for time filters, not timestamp
end_timeDateTime64(9, UTC)
duration_nsInt64Nanosecondsduration_ns/1e6 for ms
status_codeStringOK, ERROR, UNSET
status_messageString
attributesString (JSON)Span attributes (e.g. http.status_code)
eventsString (JSON)Span events
source_idString

Ordered by (service_name, start_time, trace_id).

metrics

Time-series points.

ColumnTypeNotes
timestampDateTime64(9, UTC)
nameStringMetric name, e.g. container_cpu_usage_percent
typeStringgauge, counter, …
valueFloat64
source_idString
labelsString (JSON)Metric dimensions

Ordered by (name, source_id, timestamp).

Rollup / tiered / meta tables

  • `log_summary` — pre-aggregated per-pod log counts (cheap for volume charts).
  • `error_summary` — pre-aggregated error/warn rollups.
  • `cold_logs` — logs aged out of hot storage (older than the hot window; slower).
  • `unified_logs` — a view over hot + cold; query it when your window may cross the tier boundary.
  • `meta.sources` — source rows from the metadata store (name, type, status). Fully-qualified because it lives in the meta database, not observekit.

Time helpers

  • $from / $to — bound to the editor's time picker (SQL mode). Example: WHERE timestamp BETWEEN $from AND $to.
  • Or use ClickHouse directly: WHERE timestamp > now() - INTERVAL 1 HOUR.

See Query reference for operators, JSON extraction, wildcards/regex, and limits.