Metrics for event flows
An order service and an inventory service on one topic, with the outbox backlog, group lag at the broker, event age and dead letters measured where each can be seen, a provisioned Grafana dashboard and one provisioned alert.
examples/26-metrics-for-event-flows/ is two services, order-service and inventory-service, one Debezium connector and the LGTM stack with a dashboard and an alert rule loaded from files. It accompanies Metrics for event flows.
It uses Quarkus, Micrometer with OpenTelemetry export, SmallRye Reactive Messaging, the Debezium outbox, Kafka and PostgreSQL. The collector in the LGTM image gets a second configuration that reads consumer group lag from the broker.
(cd examples/domain-model && mvn -B -q install)
cd examples/26-metrics-for-event-flows
mvn -B verify
./verify.sh
What to observe
- A backlog the table cannot show. While the connector is paused the outbox table holds no rows and
outbox_backlog_bytesrises. - An alert that fires during the stall. The rule
order flow stalledreaches Alerting with no record onedp.orders.placed, and returns to Normal after the resume. - Lag the stopped consumer cannot report. With
inventory-servicestopped the broker’s group lag equals the orders waiting, and the service’s own lag metric has no new sample. - Dead letters and a redrive. Three orders for a SKU with no stock land on
edp.orders.placed-dlq; after the stock is added and the records are written back, record age reads small and event age reads the wait. - A dashboard from a file. Every panel of
edp-order-flowreturns data.
Infrastructure
Kafka, PostgreSQL, Connect and the LGTM stack from examples/_infra, merged with two small files, plus the two services. The compose project is edp-26.