Repository navigation
fix(obs): query the emitted span-export alarm series (#985) - #986
Merged
Merged
Conversation
This was referenced Nov 9, 2026
athvin
marked this pull request as ready for review
November 9, 2026 02:26
Merged
4 tasks done
Contributor
terraform plan
dev — 0 to add, 2 to changedata.aws_iam_policy_document.obs_pod_trust: Reading...
data.aws_iam_openid_connect_provider.github: Reading...
data.aws_caller_identity.current: Reading...
module.network.data.aws_availability_zones.available: Reading...
data.aws_iam_policy_document.er_api_pod_trust: Reading...
data.aws_iam_policy_document.eso: Reading...
data.aws_iam_policy_document.eso: Read complete after 0s [id=1725605485]
data.aws_iam_policy_document.obs_pod_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.er_api_pod_trust: Read complete after 0s [id=819195744]
data.aws_region.current: Reading...
module.network.data.aws_region.current: Reading...
data.aws_iam_policy_document.eso_trust: Reading...
data.aws_region.current: Read complete after 0s [id=us-east-2]
data.aws_iam_policy_document.eso_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.efs_csi_trust: Reading...
data.aws_rds_engine_version.aurora_pg: Reading...
data.aws_caller_identity.current: Read complete after 0s [id=797781631727]
data.aws_iam_policy_document.efs_csi_trust: Read complete after 0s [id=819195744]
module.eks.data.aws_iam_policy_document.node_trust: Reading...
module.eks.data.aws_iam_policy_document.cluster_trust: Reading...
module.eks.data.aws_iam_policy_document.cluster_trust: Read complete after 0s [id=1029077455]
module.eks.data.aws_iam_policy_document.node_trust: Read complete after 0s [id=2851119427]
data.aws_iam_policy_document.fluent_bit: Reading...
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: Read complete after 0s [id=4006586444]
data.aws_iam_policy_document.bedrock_invoke: Reading...
data.aws_iam_policy_document.bedrock_invoke: Read complete after 0s [id=3601248236]
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_iam_policy_document.lake_access: Reading...
module.network.data.aws_availability_zones.available: Read complete after 1s [id=us-east-2]
data.aws_iam_policy_document.lake_access: Read complete after 0s [id=3442692123]
data.aws_rds_engine_version.aurora_pg: Read complete after 1s [id=17.9]
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_openid_connect_provider.github: Read complete after 1s [id=arn:aws:iam::797781631727:oidc-provider/token.actions.githubusercontent.com]
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:
~ update in-place
Terraform will perform the following actions:
# aws_cloudwatch_metric_alarm.span_export_silence["api"] will be updated in-place
~ resource "aws_cloudwatch_metric_alarm" "span_export_silence" {
id = "er-dev-span-export-silence-api"
# (22 unchanged attributes hidden)
- metric_query {
- id = "ended" -> null
- return_data = false -> null
# (3 unchanged attributes hidden)
- metric {
- dimensions = {
- "er.role" = "api"
} -> null
- metric_name = "er.telemetry.spans_ended" -> null
- namespace = "ER/Dev" -> null
- period = 300 -> null
- stat = "Maximum" -> null
# (1 unchanged attribute hidden)
}
}
- metric_query {
- id = "exported" -> null
- return_data = false -> null
# (3 unchanged attributes hidden)
- metric {
- dimensions = {
- "er.role" = "api"
} -> null
- metric_name = "er.telemetry.spans_exported" -> null
- namespace = "ER/Dev" -> null
- period = 300 -> null
- stat = "Maximum" -> null
# (1 unchanged attribute hidden)
}
}
- metric_query {
- expression = "IF(RATE(ended)>0 AND RATE(exported)==0, 1, 0)" -> null
- id = "silence" -> null
- label = "spans ending but none exported" -> null
- return_data = true -> null
# (1 unchanged attribute hidden)
}
+ metric_query {
+ id = "ended"
+ return_data = false
# (3 unchanged attributes hidden)
+ metric {
+ dimensions = {
+ "OTelLib" = "er-obs"
+ "er.role" = "api"
}
+ metric_name = "er.telemetry.spans_ended"
+ namespace = "ER/Dev"
+ period = 300
+ stat = "Sum"
# (1 unchanged attribute hidden)
}
}
+ metric_query {
+ id = "exported"
+ return_data = false
# (3 unchanged attributes hidden)
+ metric {
+ dimensions = {
+ "OTelLib" = "er-obs"
+ "er.role" = "api"
}
+ metric_name = "er.telemetry.spans_exported"
+ namespace = "ER/Dev"
+ period = 300
+ stat = "Sum"
# (1 unchanged attribute hidden)
}
}
+ metric_query {
+ expression = "IF(ended>0 AND FILL(exported,0)==0, 1, 0)"
+ id = "silence"
+ label = "spans ending but none exported"
+ return_data = true
# (1 unchanged attribute hidden)
}
}
# aws_cloudwatch_metric_alarm.span_export_silence["dispatcher"] will be updated in-place
~ resource "aws_cloudwatch_metric_alarm" "span_export_silence" {
id = "er-dev-span-export-silence-dispatcher"
# (22 unchanged attributes hidden)
- metric_query {
- id = "ended" -> null
- return_data = false -> null
# (3 unchanged attributes hidden)
- metric {
- dimensions = {
- "er.role" = "dispatcher"
} -> null
- metric_name = "er.telemetry.spans_ended" -> null
- namespace = "ER/Dev" -> null
- period = 300 -> null
- stat = "Maximum" -> null
# (1 unchanged attribute hidden)
}
}
- metric_query {
- id = "exported" -> null
- return_data = false -> null
# (3 unchanged attributes hidden)
- metric {
- dimensions = {
- "er.role" = "dispatcher"
} -> null
- metric_name = "er.telemetry.spans_exported" -> null
- namespace = "ER/Dev" -> null
- period = 300 -> null
- stat = "Maximum" -> null
# (1 unchanged attribute hidden)
}
}
- metric_query {
- expression = "IF(RATE(ended)>0 AND RATE(exported)==0, 1, 0)" -> null
- id = "silence" -> null
- label = "spans ending but none exported" -> null
- return_data = true -> null
# (1 unchanged attribute hidden)
}
+ metric_query {
+ id = "ended"
+ return_data = false
# (3 unchanged attributes hidden)
+ metric {
+ dimensions = {
+ "OTelLib" = "er-obs"
+ "er.role" = "dispatcher"
}
+ metric_name = "er.telemetry.spans_ended"
+ namespace = "ER/Dev"
+ period = 300
+ stat = "Sum"
# (1 unchanged attribute hidden)
}
}
+ metric_query {
+ id = "exported"
+ return_data = false
# (3 unchanged attributes hidden)
+ metric {
+ dimensions = {
+ "OTelLib" = "er-obs"
+ "er.role" = "dispatcher"
}
+ metric_name = "er.telemetry.spans_exported"
+ namespace = "ER/Dev"
+ period = 300
+ stat = "Sum"
# (1 unchanged attribute hidden)
}
}
+ metric_query {
+ expression = "IF(ended>0 AND FILL(exported,0)==0, 1, 0)"
+ id = "silence"
+ label = "spans ending but none exported"
+ return_data = true
# (1 unchanged attribute hidden)
}
}
Plan: 0 to add, 2 to change, 0 to destroy.
|
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 #985
What
Repair the span-export alarms introduced by #942 so they query the CloudWatch series the collector actually emits. Share the existing public R2 account input across plan and apply to make the required Terraform preview accurately show this change.
Why
Both alarms currently read nonexistent dimension sets and apply RATE to interval deltas, leaving export silence undetected.
Proof
make skills-check, actionlint, workflow-shell-check, and credential-free validation of all five stacks pass. Independent pr-review on df0af58 found no reuse/prose issues.Risk & rollback
Changes only existing dev alarm queries. Per-role aggregation still lets a healthy replica hide a wedged peer; this does not add per-pod monitoring. Revert the squash commit to restore the previous alarm configuration.
Post-merge ledger
Closed by: Codex · session
01a1be1b-0c92-7703-a4c2-25cb2c999baaonMac.lan· 2026-11-09T02:45:34.712962+00:00Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Plan prerequisite fixed: the first CI run proposed deleting the core R2 bucket because only apply received TF_VAR_cloudflare_account_id. An isolated credential-free plan of the actual R2 resources passed with that public input and -refresh=false. The workflow now supplies the existing account ID at workflow scope so plan and apply agree; no token is exposed and the apply identity/value is unchanged. CI run 42551482100 confirmed zero destroys across all stacks; dev has two in-place alarm updates and all other stacks have no changes.
The collector adds OTelLib even with NoDimensionRollup and converts cumulative monotonic counters to deltas. Live ListMetrics showed both dimensions; the old dimension set returned no points. Upstream behavior: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.161.0/exporter/awsemfexporter/README.md . Root-cause investigation preserved separately in #987.
Measurements
Live GetMetricStatistics with the corrected dimensions returned matching positive sums (20 ended / 20 exported) for the API role, then zeros during idle time. The original role-only queries returned no data. The synthetic read-only metric-math probe returned six breach points for both wedge scenarios and six clear points for healthy and idle cases.
Files