Examples
Runnable examples ship in the pymidil repository under
examples/. A few good starting points:
Zero-refactor observation
examples/event/kafka_observer.py
wraps an existing aiokafka consumer and producer with ConsumerObserver/ProducerObserver,
including trace header propagation and honoring dashboard pause/throttle. The pattern shown there
carries over to any broker client.
The full event-runtime tour
examples/event/sqs_fanout/ shows
one order-placed event fanning out to four downstream services on SQS, with retries, dead-lettering,
and idempotency all wired up. One branch is deliberately unreliable so you can watch it retry and
eventually dead-letter, then see the whole shape of it in the Trace Graph
and DLQ Center.
Idempotency and dead-letter telemetry, without a broker
examples/event/idempotency_dlq.py is
a minimal, broker-free script showing exactly what happens on a duplicate delivery and on a
dead-lettered event, useful for seeing the mechanics in isolation before wiring up real
infrastructure.