SCHEMA — observability¶
The local log and metrics planes' configuration: the Logstash pipelines, the container-log shipper, the OpenTelemetry collector and Prometheus that receive Claude Code's native telemetry, and the Elasticsearch, Kibana and Grafana objects the stack is bootstrapped with.
Conventions¶
- Nothing here is hand-authored except the pipelines and the shipper. Everything under
elasticsearch/,kibana/andgrafana/dashboards/is rendered from_data/fleet.ymlobservability:bydash observe verify --write— retention, mappings, data views and both dashboards. Edit the contract, re-render, commit both. - Saved-object ids and datasource uids are pinned in the generated files. The Harness Console embeds them by id, so a minted id is a blank iframe with no error anywhere.
- Each config is mounted read-only into its container by
docker-compose.yml'selkprofile, or itsmetricsprofile forotel-collector/andprometheus/.
Structure¶
| entry | kind | purpose | rules |
|---|---|---|---|
SCHEMA.md |
file | This contract | required |
bootstrap.sh |
file | Idempotently installs the rendered objects into a running stack (PUT ILM + templates, import Kibana saved objects, report Grafana); run by dash observe up |
required |
logstash/ |
dir | The one normalization and redaction path — pipelines.yml plus pipeline/*.conf: three inputs (beats, http, otlp — Claude Code's OTel events from the collector) feeding one shared enrich output. Logstash's own config format, not a pyramid level |
required terminal |
filebeat/ |
dir | filebeat.yml, the container-log shipper — label-gated docker autodiscover; vendored to the fleet as templates/elk/filebeat.fleet.yml and held equal by drift check (i) |
required terminal |
elasticsearch/ |
dir | ilm-policies.json + index-templates.json, rendered from the contract's retention_days / rollover / datasets |
generated |
kibana/ |
dir | dashboards.ndjson — data views, saved searches and the pinned dashboards, in Kibana's import format (one object per line; a JSON array is rejected) |
generated |
otel-collector/ |
dir | config.yaml — the one OTLP ingress for Claude Code's native telemetry: metrics → Prometheus, events → Logstash otlp-in (never straight to Elasticsearch), traces → Phoenix mapped to OpenInference span kinds. Held to _data/fleet.yml observability.claude_code by test_observe_contract.py. Beside it, genai-openinference.yml: the one map of Claude Code ↔ OTel GenAI ↔ OpenInference span attributes with the semconv versions it was written against, held to the transform by tools/test_activity_contract.py (HUB-072) |
required terminal |
prometheus/ |
dir | prometheus.yml — scrapes the collector's exporter (protobuf first, for start timestamps); retention lives on the compose command line, from observability.metrics.retention |
required terminal |
grafana/ |
dir | provisioning/ (datasource with a pinned uid + the dashboard provider, hand-authored) and dashboards/fleet-logs.json (generated, pinned uid) |
required terminal |
Placement¶
- New Logstash input or filter →
logstash/pipeline/<NN>-<name>.conf, registered inpipelines.yml; redaction and ECS mapping stay in90-enrich-out.conf - New collector route or processor →
otel-collector/config.yaml; events still go to Logstash, never to an exporter that writes Elasticsearch directly - New span attribute mapping → a row in
otel-collector/genai-openinference.ymlfirst, then the statement inconfig.yaml'stransform/openinference - New dataset, retention change, or dashboard panel →
_data/fleet.ymlobservability:and the renderers in.github/scripts/dash-gen/fleet_observe.py, thendash observe verify --write - Anything unrouted → propose an entry in this table first, then create it.
Forbidden¶
- No hand-edits to the
generatedentries —dash observe verifyfails on the diff and the next--writediscards them. - No credentials: the stack runs security-off on loopback precisely so none are needed, and
_data/and this tree are public. - No second redaction point. One shared
enrichpipeline, or the next input added leaks.