You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Active revision:ca-grubify-ijid2sq6n3hr6--0000006 (100% traffic)
Summary
HTTP 5xx errors were triggered during a deployment that created new revisions (0000005 → 0000006) with a misconfigured datadog/agent:7 sidecar container. The Datadog agent immediately entered a crash-loop (ContainerBackOff) due to missing DD_HOSTNAME environment variable, causing transient 5xx responses during the revision transition. The Grubify API container itself started successfully and is serving HTTP 200.
Impact
Transient 5xx errors during ~3-minute deployment window (15:19–15:23 UTC)
21 requests observed in the affected window (11 + 10 in two 5-min buckets)
Datadog agent sidecar is still crash-looping (wasting resources, no APM telemetry)
~15:24:36: Second ContainerBackOff event (sidecar still crash-looping)
Evidence
System logs (revision 0000006)
ContainerBackOff | Persistent Failure to start container (count: 2)
Datadog agent errors (sidecar)
Error: Error while getting hostname, exiting: unable to reliably determine the host name.
You can define one in the agent config file or in your hosts file
Error: couldn't get hostname from core agent at "/opt/datadog-agent/bin/agent/agent": exit status 255.
Set DD_HOSTNAME or hostname in the agent config
Primary: A deployment at 15:19–15:20 UTC added a datadog/agent:7 sidecar container without configuring the required DD_HOSTNAME environment variable. The sidecar immediately crash-looped, and during the revision transition window, incoming requests received 5xx responses before the new revision's main container was fully ready.
Secondary (latent): The deployed grubify-api:dd-instrumented image and the source repo (main branch) still contain the CartController memory leak (static unbounded List<byte[]> with 10MB allocations per POST request). This will cause OutOfMemoryException and HTTP 5xx under sustained POST /api/cart traffic. See #318.
Remediation
Sidecar fix: Set DD_HOSTNAME environment variable on the datadog-agent container (e.g., via az containerapp update with container env vars, or use DD_HOSTNAME set to the container app name)
Incident Report: HTTP 5xx during deployment — Datadog agent sidecar crash-loop
fe518660-7b59-4bac-a225-6a1a0c72f000ca-grubify-ijid2sq6n3hr6(rg:rg-sre-lab02)a9096d06-8ee3-4532-9b34-aa3bb3570226ca-grubify-ijid2sq6n3hr6.victoriousmeadow-21ce84b0.eastus2.azurecontainerapps.ioca-grubify-ijid2sq6n3hr6--0000006(100% traffic)Summary
HTTP 5xx errors were triggered during a deployment that created new revisions (0000005 → 0000006) with a misconfigured
datadog/agent:7sidecar container. The Datadog agent immediately entered a crash-loop (ContainerBackOff) due to missingDD_HOSTNAMEenvironment variable, causing transient 5xx responses during the revision transition. The Grubify API container itself started successfully and is serving HTTP 200.Impact
grubify-api:dd-instrumentedlikely still contains the CartController memory leak (10MB/request unbounded allocation — see [Incident] Recurring memory leak in CartController.AddItemToCart causing HTTP 5xx #318)Timeline (UTC)
containerApps/writeoperation (caller:4ace62cf-...) — created revision 0000005containerApps/writeoperation — created revision 0000006--0000006created (image:grubify-api:dd-instrumented+datadog/agent:7sidecar)ContainerBackOffwarning — "Persistent Failure to start container"alert-http-5xx-sre-lab02fired (Sev3)ContainerBackOffevent (sidecar still crash-looping)Evidence
System logs (revision 0000006)
Datadog agent errors (sidecar)
Metrics snapshot (Azure Monitor)
Current CartController.cs (repo main branch)
The memory leak code is still present in the source:
Root Cause
Primary: A deployment at 15:19–15:20 UTC added a
datadog/agent:7sidecar container without configuring the requiredDD_HOSTNAMEenvironment variable. The sidecar immediately crash-looped, and during the revision transition window, incoming requests received 5xx responses before the new revision's main container was fully ready.Secondary (latent): The deployed
grubify-api:dd-instrumentedimage and the source repo (mainbranch) still contain the CartController memory leak (static unboundedList<byte[]>with 10MB allocations per POST request). This will causeOutOfMemoryExceptionand HTTP 5xx under sustained POST/api/carttraffic. See #318.Remediation
DD_HOSTNAMEenvironment variable on thedatadog-agentcontainer (e.g., viaaz containerapp updatewith container env vars, or useDD_HOSTNAMEset to the container app name)RequestDataCacheand 10MB allocation fromCartController.AddItemToCart— code fix still pending from [Incident] Recurring memory leak in CartController.AddItemToCart causing HTTP 5xx #318Action Items
DD_HOSTNAMEenv var on datadog-agent sidecar to stop crash-loopReferences
/subscriptions/a9096d06-8ee3-4532-9b34-aa3bb3570226/resourceGroups/rg-sre-lab02/providers/Microsoft.App/containerApps/ca-grubify-ijid2sq6n3hr6e00dbb2d-5906-4228-97c0-3cf6538e8aa7