Commit Graph
3 Commits
Author SHA1 Message Date
ArtyomandClaude Opus 5.5 e60b4eac98 Start the OpenTelemetry SDK in every process
Add the OpenTelemetry API and SDK, the OTLP over HTTP exporter and the
FastAPI and asyncpg instrumentations to the lock, and a platform module
that builds one resource per process (service.name, service.version,
service.instance.id as hostname and pid, deployment.environment.name
from OTEL_RESOURCE_ATTRIBUTES), batch processors for traces and logs,
a periodic metric reader, PostgreSQL client spans and a bounded
shutdown in a daemon thread instead of the 30 s flush of the SDK. The
SDK stays off without a Collector address or with OTEL_SDK_DISABLED.

The sampler lets only server, consumer and producer spans open a
trace, so readiness probes, outbox polls and sweeps do not become
one-span traces. Log records carry trace_id and span_id in stdout and
go to OTLP through a handler that keeps only the allowlisted fields,
and deferred event subscribers now run in the context the event was
emitted in, so audit records stay linked to their request or job.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-29 04:45:14 +03:00
ArtyomandClaude Opus 5.5 a41d6d39e8 Propose the telemetry pipeline as an openspec change
Add the change add-lab6-telemetry-pipeline for level 3 of lab 6: every
API worker process, the relay and the worker start the OpenTelemetry
SDK after fork with service.name, service.version, a per-process
service.instance.id and deployment.environment.name, export OTLP over
HTTP with batch processors only, record HTTP server spans and the
seconds histogram by route template, consumer spans and the
jobs.processed counter and job.duration histogram by job type and
outcome, PostgreSQL client spans inside requests and jobs, and send
every allowlisted log record to Loki with trace_id and span_id. The
stand gains the Collector, Prometheus, Loki, Tempo and Grafana with
volumes and provisioning from Git, built from the verified .prep/lab6
configuration.

The specs add lab6-service-telemetry and lab6-telemetry-stack and
extend the unified log requirement of lab1-service-operability.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-29 04:37:41 +03:00
ArtyomandClaude Opus 5.5 a0d3947710 Carry over the agent context and openspec history from lab 5
Bring the Claude Code settings, the lint hook, the opsx commands and
skills, the architecture notes, the lab 1 to lab 5 specs and the
archived lab 1 to lab 5 changes into the lab 6 skeleton, so lab 6
continues the same spec history instead of starting from scratch. The
files come from the lab 5 solution commit 64d5c67.

Rewrite AGENTS.md and the openspec context and rules for lab 6: the
business API stays at contract 1.6.0, API, relay and worker start the
OpenTelemetry SDK in every process after fork and export OTLP over HTTP
to a separate Collector, Prometheus, Loki and Tempo store metrics, logs
and traces on volumes, Grafana only reads them through provisioning
kept in Git, telemetry never blocks a request and never feeds
/health/ready, metric labels stay low-cardinality and message bodies
and secrets never leave the process. Out of scope moves to lab 7,
track 2 and clustered telemetry backends.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-29 03:46:20 +03:00