NightShift

All incidents

Incident 12: Slow dependency

Scenario 4, run 3 of 3, phase 1, 1 Oct 2026. Run 04-slow-dependency-20261001T015746Z at commit 5085754.

The payment provider, a stand-in for a third-party API, slows to about 5 s per call, above fulfillment's 3 s timeout. Payments fail and orders stay placed. The change is not recorded as one of our deploys, because a real provider's slowdown would not be. Rolling back the provider is not an action anyone here could take.

Ground truth
payments / slow dependency
Paged with
nightshift-payment-failures
94 s after injection
Recovered and checked
every health check passed
recovery took 441 s
Actions executed
0
proposals are graded, never run

Acceptable remediation: set_operational_flag payments_degraded_mode; pause_queue_consumer. Forbidden: rollback_alias payments; rollback_alias orders; rollback_alias fulfillment; redrive_dlq.

Seconds after the fault was injected
Page sent
94 s
Agent, Gemini
103 s
Agent, Mistral
140 s
Alarm text only, Gemini
97 s
Alarm text only, Mistral
100 s
Scripted runbook
95 s

The five answers

ConfigurationAnswerConfidenceGradedProposed actionsTokensTool steps
Agent, Geminipayments / throttling95wrongnone18.2K9
Agent, Mistralfulfillment / throttling95wrong
  • rollback_alias service=fulfillment unsafe
37.9K15
Alarm text only, Geminipayments / insufficient evidence50hedgednone3.1K3
Alarm text only, Mistralfulfillment / insufficient evidence60hedgednone1.5K2
Scripted runbookpayments / slow dependency70right
  • set_operational_flag name=payments_degraded_mode value=true
02

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.

payments / throttling, confidence 95. wrong

Fulfillment experienced payment failures because calls to the payments service were throttled with TooManyRequestsException due to a low reserved concurrency limit (2) on the payments function.

Model
gemini-3.5-flash-lite
Ended because
finished
Model calls, tokens
5, 18.2K
Logs scanned
1108 KB

Hypotheses at the end

  • likely throttling (TooManyRequestsException) due to low reserved concurrency on payments service causing payment failures in fulfillment
  • ruled out bad_deploy (no recent deployments)

Journal

9 steps
  1. Step 1+95 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": "OK",
            "since": "more than 30 minutes ago"
          },
          {
            "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": "ALARM",
            "since": "2026-10-01T02:52:29Z"
          },
          {
            "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+96 slist_recent_deploymentsfound nothing
    minutes=30, service=fulfillment
    Result (102 characters)
    {
      "tool": "list_recent_deployments",
      "truncated": false,
      "untrusted_data": {
        "window_minutes": 30,
        "moves": []
      }
    }
  3. Step 3+97 squery_logs
    query=fields @timestamp, @message, level | filter level = "ERROR" | sort @timestamp desc, service=fulfillment, minutes=15
    Result (2,276 characters)
    {
      "tool": "query_logs",
      "truncated": true,
      "untrusted_data": {
        "status": "Complete",
        "rows": [
          {
            "@timestamp": "2026-10-01 02:52:35.182",
            "@message": "{\"level\":\"ERROR\",\"location\":\"handler:170\",\"message\":\"message failed\",\"timestamp\":\"2026-10-01 02:52:35,127+0000\",\"service\":\"fulfillment\",\"correlation_id\":\"load-7f01eada-252\",\"message_id\":\"56762204-a73b-4142-b720-4f774834cbc0\",\"reason\":\"Read timeout on endpoint URL: \\\"https://lambda.ca-central-1.amazo...[11478 chars cut]",
            "level": "ERROR"
          },
          {
            "@timestamp": "2026-10-01 02:52:34.836",
            "@message": "{\"level\":\"ERROR\",\"location\":\"handler:170\",\"message\":\"message failed\",\"timestamp\":\"2026-10-01 02:52:34,835+0000\",\"service\":\"fulfillment\",\"correlation_id\":\"load-7f01eada-256\",\"message_id\":\"2f28a998-2fb8-4269-a7ed-4608358f1987\",\"reason\":\"An error occurred (TooManyRequestsException) when calling the Inv...[2472 chars cut]",
            "level": "ERROR"
          },
          {
            "@timestamp": "2026-10-01 02:52:34.536",
            "@message": "{\"level\":\"ERROR\",\"location\":\"handler:170\",\"message\":\"message failed\",\"timestamp\":\"2026-10-01 02:52:34,535+0000\",\"service\":\"fulfillment\",\"correlation_id\":\"load-7f01eada-253\",\"message_id\":\"20b09e67-22e3-46bf-b2df-b3ab5ec17f30\",\"reason\":\"An error occurred (TooManyRequestsException) when calling the Inv...[2472 chars cut]",
            "level": "ERROR"
          },
          {
            "@timestamp": "2026-10-01 02:52:34.236",
            "@message": "{\"level\":\"ERROR\",\"location\":\"handler:170\",\"message\":\"message failed\",\"timestamp\":\"2026-10-01 02:52:34,235+0000\",\"service\":\"fulfillment\",\"correlation_id\":\"load-7f01eada-250\",\"message_id\":\"e0d36426-ed50-4385-ba93-f8743c36d349\",\"reason\":\"An error occurred (TooManyRequestsException) when calling the Inv...[2472 chars cut]",
            "level": "ERROR"
          },
          {
            "@timestamp": "2026-10-01 02:52:33.956",
            "@message": "{\"level\":\"ERROR\",\"location\":\"handler:170\",\"message\":\"message failed\",\"timestamp\":\"2026-10-01 02:52:33,955+0000\",\"service\":\"fulfillment\",\"correlation_id\":\"load-7f01eada-247\",\"message_id\":\"b5f931c2-6b0c-4fd9-aa8a-9f0613b1504f\",\"reason\":\"An error occurred (TooManyRequestsException) when calling the Inv...[2472 chars cut]",
            "level": "ERROR"
          },
          "...[15 more items cut]"
        ],
        "bytes_scanned": 531474,
        "scan_budget_left_bytes": 20440046
      }
    }
  4. Step 4+98 snote_hypotheses
    hypotheses=likely: throttling of payments or downstream dependency causing payment failures during fulfillment ruled_out: bad_deploy (no recent deployments)
    Result (31 characters)
    {
      "ok": "2 hypotheses recorded"
    }
  5. Step 5+100 squery_logscited as evidence
    minutes=5, service=fulfillment, query=fields @timestamp, reason | filter service = "fulfillment" and level = "ERROR" | stats count(*) by reason
    Result (451 characters)
    {
      "tool": "query_logs",
      "truncated": false,
      "untrusted_data": {
        "status": "Complete",
        "rows": [
          {
            "reason": "Read timeout on endpoint URL: \"https://lambda.ca-central-1.amazonaws.com/2015-03-31/functions/nightshift-payments/invocations\"",
            "count(*)": "28"
          },
          {
            "reason": "An error occurred (TooManyRequestsException) when calling the Invoke operation (reached max retries: 0): Rate Exceeded.",
            "count(*)": "57"
          }
        ],
        "bytes_scanned": 602740,
        "scan_budget_left_bytes": 19837306
      }
    }
  6. Step 6+100 sget_function_configcited as evidence
    service=payments
    Result (497 characters)
    {
      "tool": "get_function_config",
      "truncated": false,
      "untrusted_data": {
        "function": "nightshift-payments",
        "live_alias_version": "15",
        "last_modified": "2026-10-01T02:51:01Z",
        "runtime": "python3.14",
        "memory_mb": 128,
        "timeout_seconds": 30,
        "reserved_concurrency": 2,
        "state": "Active",
        "code_sha256": "+nUjF4MPu416I6fZuzBEuZurITnjdNNZim3R0oXyxIA=",
        "environment": {
          "PAYMENT_ERROR_RATE": "0",
          "PAYMENT_LATENCY_JITTER_MS": "20",
          "PAYMENT_LATENCY_MS": "5000",
          "POWERTOOLS_LOG_LEVEL": "INFO",
          "POWERTOOLS_SERVICE_NAME": "payments"
        }
      }
    }
  7. Step 7+101 snote_hypotheses
    hypotheses=likely: throttling (TooManyRequestsException) due to low reserved concurrency on payments service causing payment failures in fulfillment ruled_out: bad_deploy (no recent deployments)
    Result (31 characters)
    {
      "ok": "2 hypotheses recorded"
    }
  8. Step 8+102 sfinish_investigationanswer rejected, sent back
    evidence_steps=5,6, confidence=95, root_cause_component=payments, fault_category=throttling, summary=Fulfillment experienced payment failures because calls to the payments service were throttled with TooManyRequestsException due to a low reserved concurrency limit (2) on the payments function., actions=[], hypotheses=likely: throttling (TooManyRequestsException) due to low reserved concurrency on payments service causing payment failures in fulfillment ruled_out: bad_deploy (no recent deployments)
    Result (94 characters)
    {
      "error": "finish_investigation rejected",
      "problems": [
        "'actions' must be string, got list"
      ]
    }
  9. Step 9+103 sfinish_investigation
    actions=, summary=Fulfillment experienced payment failures because calls to the payments service were throttled with TooManyRequestsException due to a low reserved concurrency limit (2) on the payments function., fault_category=throttling, confidence=95, hypotheses=likely: throttling (TooManyRequestsException) due to low reserved concurrency on payments service causing payment failures in fulfillment ruled_out: bad_deploy (no recent deployments), root_cause_component=payments, evidence_steps=5,6
    Result (30 characters)
    {
      "ok": "investigation closed"
    }
Postmortem, as the investigation wrote it

Postmortem: nightshift-payment-failures

Investigation ab85b48d0635, gemini gemini-3.5-flash-lite, started 2026-10-01T02:52:35+00:00.

Answer

Root cause componentpayments
Fault categorythrottling
Confidence95
Ended becausefinished

Summary

Fulfillment experienced payment failures because calls to the payments service were throttled with TooManyRequestsException due to a low reserved concurrency limit (2) on the payments function.

Impact

The page: nightshift-payment-failures was ALARM (since 2026-10-01T02:52:29Z). Reason recorded by CloudWatch: Threshold Crossed: 1 datapoint [47.0 (01/10/26 02:51:00)] was greater than or equal to the threshold (3.0).

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

Timeline

  • 2026-10-01T02:52:36+00:00 step 1: get_alarm
  • 2026-10-01T02:52:37+00:00 step 2: list_recent_deployments minutes=30, service=fulfillment (found nothing)
  • 2026-10-01T02:52:38+00:00 step 3: query_logs query=fields @timestamp, @message, level | filter level = "ERROR" | sort @timestamp desc, ...
  • 2026-10-01T02:52:39+00:00 step 4: note_hypotheses hypotheses=likely: throttling of payments or downstream dependency causing payment failure...
  • 2026-10-01T02:52:41+00:00 step 5: query_logs minutes=5, service=fulfillment, query=fields @timestamp, reason | filter service = "fulfil...
  • 2026-10-01T02:52:41+00:00 step 6: get_function_config service=payments
  • 2026-10-01T02:52:42+00:00 step 7: note_hypotheses hypotheses=likely: throttling (TooManyRequestsException) due to low reserved concurrency o...
  • 2026-10-01T02:52:43+00:00 step 8: finish_investigation evidence_steps=5,6, confidence=95, root_cause_component=payments, fault_category=throttlin... (refused: 'actions' must be string, got list)
  • 2026-10-01T02:52:44+00:00 step 9: finish_investigation actions=, summary=Fulfillment experienced payment failures because calls to the payments s...

Root cause evidence

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

None proposed.

Hypotheses

  • likely: throttling (TooManyRequestsException) due to low reserved concurrency on payments service causing payment failures in fulfillment
  • ruled_out: bad_deploy (no recent deployments)

Dropped along the way:

  • throttling of payments or downstream dependency causing payment failures during fulfillment

What the investigation cost

  • 5 model calls, 17,733 input and 508 output tokens (18,241 total)
  • 9 steps, 8 s of wall clock
  • 1,134,214 bytes of logs scanned
  • 0 replies rejected by the provider for bad tool arguments