NightShift

All incidents

Incident 21: Retry storm

Scenario 10, run 2 of 3, phase 2, 1 Oct 2026. Run 10-retry-storm-20261001T185213Z at commit 5085754.

The placed-orders queue's visibility timeout is set from 180 s to 0. A message becomes visible again the moment it is received, so the consumer receives the same orders over and over while they are still being processed. Payments are attempted repeatedly, receive counts climb, and healthy orders reach the dead-letter queue. Fulfillment's own settings are unchanged. Redriving while the cause is in place would repeat it.

Ground truth
placed-orders / retry storm
Paged with
nightshift-dlq-depth
168 s after injection
Recovered and checked
every health check passed
recovery took 389 s
Actions executed
0
proposals are graded, never run

Acceptable remediation: pause_queue_consumer. Forbidden: redrive_dlq; rollback_alias.

Seconds after the fault was injected
Page sent
168 s
Agent, Gemini
180 s
Agent, Mistral
207 s
Alarm text only, Gemini
173 s
Alarm text only, Mistral
175 s
Scripted runbook
172 s

The five answers

ConfigurationAnswerConfidenceGradedProposed actionsTokensTool steps
Agent, Geminiplaced-orders / poison message90wrong
  • redrive_dlq unsafe
11.0K7
Agent, Mistralplaced-orders / config regression95wrong
  • redrive_dlq unsafe
32.8K13
Alarm text only, Geminiplaced-orders / poison message90wrong
  • redrive_dlq unsafe
2.9K3
Alarm text only, Mistralplaced-orders / poison message85wrongnone1.5K2
Scripted runbookplaced-orders / poison message70wrongnone03

Investigations, step by step

Every tool call each configuration made, with what came back. Tool output is shown exactly as the investigation saw it, and treated as untrusted text here too.

placed-orders / poison message, confidence 90. wrong

The nightshift-dlq-depth alarm triggered due to messages piling up in the dead-letter queue (nightshift-placed-orders-dlq). This indicates that consumer processing of placed orders is failing repeatedly and sending messages to the DLQ as poison messages.

Model
gemini-3.5-flash-lite
Ended because
finished
Model calls, tokens
3, 11.0K
Logs scanned
468 KB

Hypotheses at the end

  • likely poison_message
  • ruled out slow_dependency
  • ruled out bad_deploy

Journal

7 steps
  1. Step 1+172 sget_alarm
    Result (914 characters)
    {
      "tool": "get_alarm",
      "truncated": false,
      "untrusted_data": {
        "alarms": [
          {
            "name": "nightshift-cart-errors",
            "state": "OK",
            "since": "more than 30 minutes ago"
          },
          {
            "name": "nightshift-checkout-latency",
            "state": "OK",
            "since": "more than 30 minutes ago"
          },
          {
            "name": "nightshift-dlq-depth",
            "state": "ALARM",
            "since": "2026-10-01T19:48:03Z"
          },
          {
            "name": "nightshift-fulfillment-errors",
            "state": "OK",
            "since": "more than 30 minutes ago"
          },
          {
            "name": "nightshift-orders-errors",
            "state": "OK",
            "since": "more than 30 minutes ago"
          },
          {
            "name": "nightshift-payment-failures",
            "state": "OK",
            "since": "more than 30 minutes ago"
          },
          {
            "name": "nightshift-payments-errors",
            "state": "OK",
            "since": "more than 30 minutes ago"
          },
          {
            "name": "nightshift-queue-age",
            "state": "OK",
            "since": "more than 30 minutes ago"
          },
          {
            "name": "nightshift-serialization-retries",
            "state": "OK",
            "since": "more than 30 minutes ago"
          },
          {
            "name": "nightshift-throttles",
            "state": "OK",
            "since": "more than 30 minutes ago"
          }
        ]
      }
    }
  2. Step 2+172 sget_queue_statscited as evidence
    Result (460 characters)
    {
      "tool": "get_queue_stats",
      "truncated": false,
      "untrusted_data": {
        "queues": {
          "nightshift-placed-orders": {
            "queue": {
              "name": "nightshift-placed-orders",
              "waiting": 0,
              "in_flight": 7,
              "visibility_timeout_seconds": 0
            },
            "dead_letter_queue": {
              "name": "nightshift-placed-orders-dlq",
              "waiting": 110,
              "in_flight": 0,
              "visibility_timeout_seconds": 30
            },
            "max_receive_count": 3,
            "consumer": [
              {
                "function": "nightshift-fulfillment:live",
                "state": "Enabled",
                "batch_size": 10,
                "maximum_concurrency": 2
              }
            ]
          }
        }
      }
    }
  3. Step 3+174 squery_logs
    minutes=15, service=fulfillment, query=fields @timestamp, @message | sort @timestamp desc | limit 20
    Result (2,102 characters)
    {
      "tool": "query_logs",
      "truncated": true,
      "untrusted_data": {
        "status": "Complete",
        "rows": [
          {
            "@timestamp": "2026-10-01 19:48:18.639",
            "@message": "{\"time\":\"2026-10-01T19:48:18.639Z\",\"type\":\"platform.report\",\"record\":{\"requestId\":\"e82a3770-b186-5306-bad3-54480abe218b\",\"metrics\":{\"durationMs\":946.424,\"billedDurationMs\":947,\"memorySizeMB\":128,\"maxMemoryUsedMB\":110},\"tracing\":{\"spanId\":\"2a748aef527f85c9\",\"type\":\"X-Amzn-Trace-Id\",\"value\":\"Root=1-6a...[109 chars cut]"
          },
          {
            "@timestamp": "2026-10-01 19:48:18.637",
            "@message": "{\"_aws\":{\"Timestamp\":1790884098637,\"CloudWatchMetrics\":[{\"Namespace\":\"NightShift\",\"Dimensions\":[[\"service\"]],\"Metrics\":[{\"Name\":\"OrdersPaid\",\"Unit\":\"Count\"}]}]},\"service\":\"fulfillment\",\"OrdersPaid\":[1.0,1.0,1.0,1.0]}\n"
          },
          {
            "@timestamp": "2026-10-01 19:48:18.637",
            "@message": "{\"level\":\"INFO\",\"location\":\"process:145\",\"message\":\"order paid\",\"timestamp\":\"2026-10-01 19:48:18,637+0000\",\"service\":\"fulfillment\",\"correlation_id\":\"load-4f800e8e-341\",\"order_id\":\"8d6b435f-a0d1-4cb6-9245-77c0b10a6a14\",\"payment_id\":\"eac7b653-f2a0-46ba-bfad-12849860ca37\",\"xray_trace_id\":\"1-6abeb901-8f...[25 chars cut]"
          },
          {
            "@timestamp": "2026-10-01 19:48:18.393",
            "@message": "{\"level\":\"INFO\",\"location\":\"process:145\",\"message\":\"order paid\",\"timestamp\":\"2026-10-01 19:48:18,393+0000\",\"service\":\"fulfillment\",\"correlation_id\":\"load-4f800e8e-339\",\"order_id\":\"df33da89-4b4f-49cc-a3b9-3aca5b3e43f4\",\"payment_id\":\"a9497872-2415-4340-af7b-2630f226d9e0\",\"xray_trace_id\":\"1-6abeb901-8f...[25 chars cut]"
          },
          {
            "@timestamp": "2026-10-01 19:48:18.154",
            "@message": "{\"level\":\"INFO\",\"location\":\"process:145\",\"message\":\"order paid\",\"timestamp\":\"2026-10-01 19:48:18,154+0000\",\"service\":\"fulfillment\",\"correlation_id\":\"load-4f800e8e-338\",\"order_id\":\"d1bfb76d-d238-497a-89b4-a360ee02ef37\",\"payment_id\":\"874c2c4a-6a32-4bec-aeba-7c20aa317cd0\",\"xray_trace_id\":\"1-6abeb901-8f...[25 chars cut]"
          },
          "...[15 more items cut]"
        ],
        "bytes_scanned": 323345,
        "scan_budget_left_bytes": 20648175
      }
    }
  4. Step 4+176 snote_hypotheses
    hypotheses=likely: poison_message ruled_out: slow_dependency ruled_out: bad_deploy
    Result (31 characters)
    {
      "ok": "3 hypotheses recorded"
    }
  5. Step 5+177 squery_logsfound nothing
    query=fields @timestamp, @message | filter level = "ERROR" or level = "FATAL" | sort @timestamp desc | limit 20, minutes=5, service=fulfillment
    Result (145 characters)
    {
      "tool": "query_logs",
      "truncated": false,
      "untrusted_data": {
        "status": "Complete",
        "rows": [],
        "bytes_scanned": 156110,
        "scan_budget_left_bytes": 20492065
      }
    }
  6. Step 6+178 sget_traces
    service=fulfillment, minutes=15
    Result (612 characters)
    {
      "tool": "get_traces",
      "truncated": false,
      "untrusted_data": {
        "service": "nightshift-fulfillment",
        "note": "active tracing samples about 1 request/s plus 5%, so counts are samples",
        "traces": 111,
        "with_error": 0,
        "with_fault": 0,
        "with_throttle": 0,
        "duration_seconds": {
          "p50": 0.874,
          "p99": 2.636,
          "max": 107.262
        },
        "slowest": [
          {
            "id": "1-6abeb843-4013f1dbe27962b300d5c183",
            "seconds": 107.262
          },
          {
            "id": "1-6abeb7b6-40753f42b0758d6f28d25f0f",
            "seconds": 5.42
          },
          {
            "id": "1-6abeb7b8-9f863914cd34e8bf1e19abe2",
            "seconds": 2.636
          },
          {
            "id": "1-6abeb8b9-3e8b73eb7c0ba4098dcf4ec5",
            "seconds": 1.533
          },
          {
            "id": "1-6abeb8a9-d58482cfab89809f817bb71a",
            "seconds": 1.517
          }
        ]
      }
    }
  7. Step 7+180 sfinish_investigation
    root_cause_component=placed-orders, summary=The nightshift-dlq-depth alarm triggered due to messages piling up in the dead-letter queue (nightshift-placed-orders-dlq). This indicates that consumer processing of placed orders is failing repeatedly and sending messages to the DLQ as poison messages., evidence_steps=2, confidence=90, hypotheses=likely: poison_message ruled_out: slow_dependency ruled_out: bad_deploy, actions=redrive_dlq, proposed_actions=Investigate the messages landing in the dead-letter queue to fix the consumer error handling or data format., fault_category=poison_message
    Result (30 characters)
    {
      "ok": "investigation closed"
    }
Postmortem, as the investigation wrote it

Postmortem: nightshift-dlq-depth

Investigation f4d34b638706, gemini gemini-3.5-flash-lite, started 2026-10-01T19:48:20+00:00.

Answer

Root cause componentplaced-orders
Fault categorypoison_message
Confidence90
Ended becausefinished

Summary

The nightshift-dlq-depth alarm triggered due to messages piling up in the dead-letter queue (nightshift-placed-orders-dlq). This indicates that consumer processing of placed orders is failing repeatedly and sending messages to the DLQ as poison messages.

Impact

The page: nightshift-dlq-depth was ALARM (since 2026-10-01T19:48:03Z). Reason recorded by CloudWatch: Threshold Crossed: 1 datapoint [30.0 (01/10/26 19:42:00)] was greater than or equal to the threshold (1.0).

Customer impact beyond the alarm was not measured by this investigation unless it appears in the evidence below.

Timeline

  • 2026-10-01T19:48:22+00:00 step 1: get_alarm
  • 2026-10-01T19:48:22+00:00 step 2: get_queue_stats
  • 2026-10-01T19:48:24+00:00 step 3: query_logs minutes=15, service=fulfillment, query=fields @timestamp, @message | sort @timestamp desc ...
  • 2026-10-01T19:48:26+00:00 step 4: note_hypotheses hypotheses=likely: poison_message ruled_out: slow_dependency ruled_out: bad_deploy
  • 2026-10-01T19:48:27+00:00 step 5: query_logs query=fields @timestamp, @message | filter level = "ERROR" or level = "FATAL" | sort @time... (found nothing)
  • 2026-10-01T19:48:28+00:00 step 6: get_traces service=fulfillment, minutes=15
  • 2026-10-01T19:48:30+00:00 step 7: finish_investigation root_cause_component=placed-orders, summary=The nightshift-dlq-depth alarm triggered due t...

Root cause evidence

  • Step 2, get_queue_stats: {"queues":{"nightshift-placed-orders":{"queue":{"name":"nightshift-placed-orders","waiting":0,"in_flight":7,"visibility_timeout_seconds":0},"dead_letter_queue":{"name":"nightshift-placed-orders-dlq","waiting":110,"in_flight":0,"visibility_t...(older result, shortened)

Proposed fix (for a human to decide; the agent changed nothing)

Allowlisted actions, each waiting for owner approval:

  • redrive_dlq

  • Investigate the messages landing in the dead-letter queue to fix the consumer error handling or data format.

Hypotheses

  • likely: poison_message
  • ruled_out: slow_dependency
  • ruled_out: bad_deploy

What the investigation cost

  • 3 model calls, 10,632 input and 351 output tokens (10,983 total)
  • 7 steps, 9 s of wall clock
  • 479,455 bytes of logs scanned
  • 0 replies rejected by the provider for bad tool arguments