Span Contracts: Trace-Driven API Contract Testing with OpenTelemetry
Detect API breaking changes by hashing response shapes from OTel spans and fail CI without storing payloads.
7 posts
Detect API breaking changes by hashing response shapes from OTel spans and fail CI without storing payloads.
Define label budgets, enforce them in CI, and add a runtime firewall to stop cardinality explosions before production.
Extract PromQL from dashboards and rules, verify selectors against /metrics, and fail CI before dashboards go dark.
Queue looks healthy until deployment, then messages_unacknowledged explodes, memory spikes, and redelivery storms start. The culprit: your prefetch is too high and nobody tested actual ack behavior.
All partitions look balanced in testing, then production traffic arrives and one partition melts. The culprit: your partition key has terrible cardinality and nobody noticed until now.
Producer upgraded Protobuf, consumer still on old version. No errors, no warnings—just silent data loss in production. Your schema evolution broke backward compatibility and CI didn't notice.
Why mocks lie and how Testcontainers will change your testing approach. Practical examples, CI setup, and data isolation strategies.