Repository navigation
feat(observability): alert on pending pods and oldest queued jobs (#1050) - #1051
Merged
Merged
Conversation
This was referenced Nov 9, 2026
Contributor
terraform plan
dev — 3 to add, 1 to changedata.aws_iam_policy_document.eso: Reading...
data.aws_iam_openid_connect_provider.github: Reading...
data.aws_iam_policy_document.efs_csi_trust: Reading...
module.network.data.aws_region.current: Reading...
module.eks.data.aws_iam_policy_document.cluster_trust: Reading...
data.aws_iam_policy_document.efs_csi_trust: Read complete after 0s [id=819195744]
module.network.data.aws_region.current: Read complete after 0s [id=us-east-2]
data.aws_iam_policy_document.eso: Read complete after 0s [id=1725605485]
module.eks.data.aws_iam_policy_document.cluster_trust: Read complete after 0s [id=1029077455]
data.aws_caller_identity.current: Reading...
data.aws_iam_policy_document.eso_trust: Reading...
data.aws_iam_policy_document.eso_trust: Read complete after 0s [id=819195744]
data.aws_region.current: Reading...
data.aws_iam_policy_document.er_api_pod_trust: Reading...
module.network.data.aws_availability_zones.available: Reading...
data.aws_iam_policy_document.er_api_pod_trust: Read complete after 0s [id=819195744]
data.aws_region.current: Read complete after 0s [id=us-east-2]
module.eks.data.aws_iam_policy_document.node_trust: Reading...
module.eks.data.aws_iam_policy_document.node_trust: Read complete after 0s [id=2851119427]
data.aws_rds_engine_version.aurora_pg: Reading...
data.aws_iam_policy_document.obs_pod_trust: Reading...
data.aws_iam_policy_document.obs_pod_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.otel_collector: Reading...
data.aws_iam_policy_document.otel_collector: Read complete after 0s [id=3111493560]
data.aws_iam_policy_document.fluent_bit: Reading...
data.aws_iam_policy_document.fluent_bit: Read complete after 0s [id=4006586444]
module.lake.data.aws_iam_policy_document.lake_tls_only: Reading...
module.lake.data.aws_iam_policy_document.lake_tls_only: Read complete after 0s [id=2205495074]
data.aws_caller_identity.current: Read complete after 0s [id=797781631727]
data.aws_iam_policy_document.lake_access: Reading...
data.aws_iam_policy_document.lake_access: Read complete after 0s [id=2921565705]
data.aws_iam_policy_document.bedrock_invoke: Reading...
data.aws_iam_policy_document.bedrock_invoke: Read complete after 0s [id=3601248236]
module.network.data.aws_availability_zones.available: Read complete after 0s [id=us-east-2]
data.aws_rds_engine_version.aurora_pg: Read complete after 0s [id=17.9]
data.aws_iam_openid_connect_provider.github: Read complete after 0s [id=arn:aws:iam::797781631727:oidc-provider/token.actions.githubusercontent.com]
data.aws_iam_policy_document.ci_deploy_dev: Reading...
data.aws_iam_policy_document.ci_deploy_dev: Read complete after 0s [id=1754478413]
data.aws_iam_policy_document.ci_deploy_dev_trust: Reading...
data.aws_iam_policy_document.ci_deploy_dev_trust: Read complete after 0s [id=4060172364]
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
~ update in-place
Terraform will perform the following actions:
# module.operations.aws_cloudwatch_dashboard.operations will be updated in-place
~ resource "aws_cloudwatch_dashboard" "operations" {
~ dashboard_body = jsonencode(
~ {
~ widgets = [
~ {
~ properties = {
~ markdown = <<-EOT
# ER dev operations (shared deployment)
- API errors are the 5xx response series. Queue and concurrency are current gauges; the snapshot heartbeat below must be present before an empty chart means idle. Counters are interval deltas, so rates divide Sum by the period. Duration charts use means, not percentiles.
+ API errors are the 5xx response series. Queue and concurrency are current gauges; the database and managed-pod snapshot heartbeats must be present before an empty age chart means idle. A missing or zero pod heartbeat means Kubernetes observations are unavailable even if database snapshots continue. Counters are interval deltas, so rates divide Sum by the period. Duration charts use means, not percentiles.
Per-tenant data quality remains in the authenticated dataset dashboard (`/{org}/{dataset}/dashboard`) and dataset `/metrics` API, backed by durable lake data. Tenant and dataset identifiers never become CloudWatch dimensions. Task counters are operational observations, not an accounting ledger.
EOT
}
# (5 unchanged attributes hidden)
},
{
height = 6
properties = {
metrics = [
[
"ER/Dev",
"er.http.requests",
"status_class",
"1xx",
"OTelLib",
"er-obs",
{
label = "1xx"
},
],
[
"ER/Dev",
"er.http.requests",
"status_class",
"2xx",
"OTelLib",
"er-obs",
{
label = "2xx"
},
],
[
"ER/Dev",
"er.http.requests",
"status_class",
"3xx",
"OTelLib",
"er-obs",
{
label = "3xx"
},
],
[
"ER/Dev",
"er.http.requests",
"status_class",
"4xx",
"OTelLib",
"er-obs",
{
label = "4xx"
},
],
[
"ER/Dev",
"er.http.requests",
"status_class",
"5xx",
"OTelLib",
"er-obs",
{
label = "5xx"
},
],
[
"ER/Dev",
"er.http.requests",
"status_class",
"other",
"OTelLib",
"er-obs",
{
label = "other"
},
],
]
period = 60
region = "us-east-2"
stat = "Sum"
title = "API responses / minute"
view = "timeSeries"
}
type = "metric"
width = 12
x = 0
y = 4
},
# (11 unchanged elements hidden)
{
height = 6
properties = {
metrics = [
[
"ER/Dev",
"er.pods.failures",
"resource_class",
"S",
"reason",
"oom",
"OTelLib",
"er-obs",
{
label = "S oom"
},
],
[
"ER/Dev",
"er.pods.failures",
"resource_class",
"S",
"reason",
"evicted",
"OTelLib",
"er-obs",
{
label = "S evicted"
},
],
[
"ER/Dev",
"er.pods.failures",
"resource_class",
"M",
"reason",
"oom",
"OTelLib",
"er-obs",
{
label = "M oom"
},
],
[
"ER/Dev",
"er.pods.failures",
"resource_class",
"M",
"reason",
"evicted",
"OTelLib",
"er-obs",
{
label = "M evicted"
},
],
[
"ER/Dev",
"er.pods.failures",
"resource_class",
"L",
"reason",
"oom",
"OTelLib",
"er-obs",
{
label = "L oom"
},
],
[
"ER/Dev",
"er.pods.failures",
"resource_class",
"L",
"reason",
"evicted",
"OTelLib",
"er-obs",
{
label = "L evicted"
},
],
[
"ER/Dev",
"er.pods.failures",
"resource_class",
"other",
"reason",
"oom",
"OTelLib",
"er-obs",
{
label = "other oom"
},
],
[
"ER/Dev",
"er.pods.failures",
"resource_class",
"other",
"reason",
"evicted",
"OTelLib",
"er-obs",
{
label = "other evicted"
},
],
]
period = 60
region = "us-east-2"
stat = "Sum"
title = "Confirmed pod OOM kills and evictions / minute"
view = "timeSeries"
}
type = "metric"
width = 24
x = 0
y = 40
},
+ {
+ height = 6
+ properties = {
+ metrics = [
+ [
+ "ER/Dev",
+ "er.jobs.queue.oldest_age",
+ "OTelLib",
+ "er-obs",
],
]
+ period = 60
+ region = "us-east-2"
+ stat = "Maximum"
+ title = "Oldest queued job (seconds, includes backoff)"
+ view = "timeSeries"
}
+ type = "metric"
+ width = 12
+ x = 0
+ y = 46
},
+ {
+ height = 6
+ properties = {
+ metrics = [
+ [
+ "ER/Dev",
+ "er.pods.pending.oldest_age",
+ "OTelLib",
+ "er-obs",
],
]
+ period = 60
+ region = "us-east-2"
+ stat = "Maximum"
+ title = "Oldest Pending runner pod (seconds)"
+ view = "timeSeries"
}
+ type = "metric"
+ width = 12
+ x = 12
+ y = 46
},
+ {
+ height = 6
+ properties = {
+ metrics = [
+ [
+ "ER/Dev",
+ "er.pods.snapshots",
+ "OTelLib",
+ "er-obs",
],
]
+ period = 60
+ region = "us-east-2"
+ stat = "Sum"
+ title = "Successful managed-pod snapshots / minute (expected about 2)"
+ view = "timeSeries"
}
+ type = "metric"
+ width = 24
+ x = 0
+ y = 52
},
]
}
)
id = "er-dev-operations"
# (3 unchanged attributes hidden)
}
# module.operations.aws_cloudwatch_metric_alarm.age["pending"] will be created
+ resource "aws_cloudwatch_metric_alarm" "age" {
+ actions_enabled = true
+ alarm_actions = [
+ "arn:aws:sns:us-east-2:797781631727:er-alerts",
]
+ alarm_description = "Oldest Pending runner pod (seconds) exceeds 600 seconds. Inspect pod scheduling, image pulls, node capacity and account vCPU quotas. Require the matching snapshot heartbeat before treating a quiet chart as healthy."
+ alarm_name = "er-dev-pod-pending"
+ arn = (known after apply)
+ comparison_operator = "GreaterThanThreshold"
+ datapoints_to_alarm = 1
+ dimensions = {
+ "OTelLib" = "er-obs"
}
+ evaluate_low_sample_count_percentiles = (known after apply)
+ evaluation_periods = 1
+ id = (known after apply)
+ metric_name = "er.pods.pending.oldest_age"
+ namespace = "ER/Dev"
+ ok_actions = [
+ "arn:aws:sns:us-east-2:797781631727:er-alerts",
]
+ period = 60
+ region = "us-east-2"
+ statistic = "Maximum"
+ tags_all = {
+ "Environment" = "dev"
+ "ManagedBy" = "terraform"
+ "Project" = "entity-resolution"
}
+ threshold = 600
+ treat_missing_data = "notBreaching"
}
# module.operations.aws_cloudwatch_metric_alarm.age["queue"] will be created
+ resource "aws_cloudwatch_metric_alarm" "age" {
+ actions_enabled = true
+ alarm_actions = [
+ "arn:aws:sns:us-east-2:797781631727:er-alerts",
]
+ alarm_description = "Oldest queued job (seconds, includes backoff) exceeds 900 seconds. Inspect dispatcher readiness, job backoff, concurrency and runner capacity. Require the matching snapshot heartbeat before treating a quiet chart as healthy."
+ alarm_name = "er-dev-queue-oldest"
+ arn = (known after apply)
+ comparison_operator = "GreaterThanThreshold"
+ datapoints_to_alarm = 1
+ dimensions = {
+ "OTelLib" = "er-obs"
}
+ evaluate_low_sample_count_percentiles = (known after apply)
+ evaluation_periods = 1
+ id = (known after apply)
+ metric_name = "er.jobs.queue.oldest_age"
+ namespace = "ER/Dev"
+ ok_actions = [
+ "arn:aws:sns:us-east-2:797781631727:er-alerts",
]
+ period = 60
+ region = "us-east-2"
+ statistic = "Maximum"
+ tags_all = {
+ "Environment" = "dev"
+ "ManagedBy" = "terraform"
+ "Project" = "entity-resolution"
}
+ threshold = 900
+ treat_missing_data = "notBreaching"
}
# module.operations.aws_cloudwatch_metric_alarm.pod_snapshot_missing will be created
+ resource "aws_cloudwatch_metric_alarm" "pod_snapshot_missing" {
+ actions_enabled = true
+ alarm_actions = [
+ "arn:aws:sns:us-east-2:797781631727:er-alerts",
]
+ alarm_description = "No successful managed-pod snapshots for three minutes. Inspect Kubernetes API access, dispatcher readiness and metric export; the pending-age gauge is stale until this recovers. Database snapshots are independent."
+ alarm_name = "er-dev-pod-snapshot-missing"
+ arn = (known after apply)
+ comparison_operator = "LessThanThreshold"
+ datapoints_to_alarm = 3
+ dimensions = {
+ "OTelLib" = "er-obs"
}
+ evaluate_low_sample_count_percentiles = (known after apply)
+ evaluation_periods = 3
+ id = (known after apply)
+ metric_name = "er.pods.snapshots"
+ namespace = "ER/Dev"
+ ok_actions = [
+ "arn:aws:sns:us-east-2:797781631727:er-alerts",
]
+ period = 60
+ region = "us-east-2"
+ statistic = "Sum"
+ tags_all = {
+ "Environment" = "dev"
+ "ManagedBy" = "terraform"
+ "Project" = "entity-resolution"
}
+ threshold = 1
+ treat_missing_data = "breaching"
}
Plan: 3 to add, 1 to change, 0 to destroy.
|
athvin
marked this pull request as ready for review
November 9, 2026 13:27
This was referenced Nov 9, 2026
8 of 9 tasks
athvin
added a commit
that referenced
this pull request
Nov 27, 2026
… interruptions, impersonation volume (#877) * feat(obs): the three remaining standalone alarms — failure rate, spot interruptions, impersonation volume (#877) #1051 shipped queue-oldest and pod-pending; these complete #877's five, each an aggregate with no tenant dimension: - attempt failure rate: failed ÷ (failed + done) of er.tasks.completed over an hour across classes, > 25% with at least 4 attempts. no_op/skipped are left out to stay within the alarm's ten-query ceiling. - spot interruptions: an EventBridge rule on aws.ec2 "EC2 Spot Instance Interruption Warning" and an alarm on its MatchedEvents, > 5/h. - impersonation volume: the BFF's writeAudit prints one identity-free `er.audit.impersonation` line per impersonation event; a log metric filter on the containers log group counts it, > 20/h. Thresholds are module variables; the impersonation pair is skipped when no log group is given. Wired in dev and prod; tftest covers each. Co-Authored-By: Claude Opus 5.5 <[email protected]> * style(infra): terraform fmt the module test The fmt + validate gate runs fmt -check recursively; the earlier fmt ran in the module directory alone and skipped tests/. --------- Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1050
What
Page on Pending runner pods older than 600 seconds and queued jobs older than 900 seconds, with current-state gauges and independent observation health.
Why
#667 explicitly separates these alerts from its externally blocked cost model. Existing queue-depth and transition metrics cannot detect one old waiting job or a silent pod observation path.
Proof
Focused age/failure units, metric export/reset tests, a real-Postgres operational projection test, entity verification, Terraform validation and its mock-provider contract test passed. Deliberately changing the pending threshold made that contract fail.
make checkpassed on final commitee1f7f37. Fullmake check-e2epassed before the trace-only follow-up, including real Postgres and DuckLake/extensions; the focused pod-observation tests passed again after it. Independent SQL, tier and reuse reviews found no issues. One instrumentation finding was confirmed, fixed and independently verified.Risk & rollback
The existing dispatcher adds a bounded managed-object observation alongside its periodic database sample; failed observations retain the last gauge and stop the independent heartbeat. Dev alarms are added through the existing module; prod collector wiring remains #944. Revert the merge to roll back.
Post-merge ledger
Closed by: Codex · session
01a1be1b-0c92-7703-a4c2-25cb2c999baaonMac-28.lan· 2026-11-09T14:25:33.666470+00:00mainis green with this change on it — merge316935918b8d8816b48f81b726c87f057a283189; rust 42629666009, frontend 42629665975, infra 42629666008 and devcontainer 42629666015 succeeded. The 30-minute watch from 13:54:55Z through 14:24:55Z found no new main failure; ancestry and landed age projection/observation trace were verified.images— 42629665974 succeeded for the merge SHA.deploy— descendant06bc5f0d31879af9c3007d814ffcb1acbbb9d5e7contains this merge (ancestry verified). Deploy 42639904666 cut prod to blue and dev to green. Independent CloudWatch Logs Insights readback founder-server listeningfrom prodapp.web-api-blue-59f8bbcbbb-vhd24.er-serverat 15:00:11.353Z (query1289ab65-8954-43c5-bc79-9524c430c81b) and devci.web-api-green-557958f6cb-csvzk.er-serverat 14:59:50.436Z (queryfd2d28bc-d3f6-4655-aecc-c985b1f65ca4), 2026-11-09.Specific to this change
er-readonlyCloudWatch queries on 2026-11-09 found realER/DevandER/Prodsamples (dimensionOTelLib=er-obs) forer.ops.snapshotsander.pods.snapshots, two samples/minute at 15:07–15:08Z, plus queue/pending oldest-age gauges at zero seconds. All seven operational alarms in both environments readOKduring the 15:12–15:13Z audit. The prior read-access limitation is resolved.er-alertsstill has a PendingConfirmation email subscription. Owner confirmation and receipt verification are tracked in Confirm the er-alerts email subscription and prove alert delivery #1056; alarm state alone does not prove delivery.Context — plan, discoveries, measurements, files
Plan
job/read/operational_queueprojection with the oldest queued creation timestamp; regenerate entity artifacts, retain backoff jobs, and derive a zero-on-empty age alongside the current queue sample.PodSnapshot. Reuse the executor's namespace-scopedPodApiand managed selector for a bounded periodic LIST; derive the maximum age of actual Pending pods. A missing required timestamp or failed/timeout LIST produces no success sample. No new watcher, RBAC, cloud credential, or retry machinery.er-obs. Keep the existing database heartbeat independent so a Kubernetes outage does not erase queue visibility. Emit zeros on healthy empty snapshots and regenerate the metric reference.make check,make check-e2e, entity/metric generation checks and credential-free Terraform validation/tests.make checkpassed onee1f7f37; exact-head CI and the 30-minute merge watch passed. Preserve blocked independent live readback honestly in the post-merge ledger.Discoveries
PodSnapshotlacked Kubernetes creation time, so local observation clocks would reset on dispatcher restart. The projection now carries the platform timestamp. Database and pod observations use independent heartbeats so an API outage cannot manufacture an empty/healthy pod chart or erase queue visibility. No account mutation was performed locally.Measurements
Files