Observing event flows
Traces, metrics and logs that follow an event across topics and services, with OpenTelemetry and Grafana LGTM.
Tracing across async hops
An order crosses a commit, a log reader and a topic, and none of them is an HTTP request. The trace context travels in the outbox row and the record header, Connect adds its own spans, and the consumer either continues the trace as a child or starts a new one with a link.
Metrics for event flows
Every service reports healthy while orders wait in a paused relay or behind a stopped consumer. Four signals are read where the work waits: the outbox backlog in the replication slot, group lag at the broker, the age of an event from the time stamped when it happened, and dead letters as a rate. One provisioned alert watches the signal that grows while the flow is stuck.
Correlated logs and traces
An operator holds an order id, and the tools hold trace ids and log lines. The order id goes on every span and in the log context of every handler, the trace id goes on every log line, and a trace that a timer starts links to the trace it continues, so one question finds everything about one order.