# lab6-observability-resilience Specification ## Purpose TBD - created by archiving change complete-lab6-observability-resilience. Update Purpose after archive. ## Requirements ### Requirement: Durable distributed context The system SHALL preserve W3C context through API, transactional outbox, relay producer and worker consumer including retries, and expose safe database and S3 client spans. #### Scenario: Deferred delivery and retry - **WHEN** an accepted upload is delivered after relay restart or retried after S3 failure - **THEN** its producer and consumer spans share the originating trace and causally valid parents, without adding fields to the normative job payload ### Requirement: Operational signals and SLO The system SHALL expose queue depth and oldest age, database pool usage and waiting, worker saturation, process CPU/RAM and durable time-to-ready; dashboards SHALL show histogram percentiles and error ratio and define availability and ready SLO windows. #### Scenario: Stopped worker - **WHEN** queued uploads wait for a stopped worker - **THEN** depth and age increase, a queue-lag alert fires and resolves after recovery #### Scenario: Unavailable database - **WHEN** PostgreSQL becomes unavailable - **THEN** API failure metrics and database client spans distinguish the dependency failure and an error-rate alert fires and resolves ### Requirement: Bounded observability failure Collector SHALL use memory limits, batching and bounded queues; unavailable telemetry storage SHALL NOT prevent business requests or cause unbounded memory growth. #### Scenario: Storage outage - **WHEN** telemetry storage is stopped during requests - **THEN** business smoke passes, measured memory remains within container limits, losses are recorded, and exports resume after recovery