[aws_otel] update assets aggregation functions and calculations - #19695
Conversation
✅ Elastic Docs Style Checker (Vale)No issues found on modified lines! The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
| changes: | ||
| - description: Update aggregation function and remove division by zero in SLO metric filter. | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/19637 |
| "artifacts": { | ||
| "investigation_guide": { | ||
| "blob": "## Database Connections High\n\n### Triage\n1. Compare peak connections to the engine `max_connections` setting (not in CloudWatch).\n2. Check for connection leaks — idle sessions accumulating over time.\n3. Review application deploys or traffic spikes that increased connection demand.\n4. Inspect `FreeableMemory` — each connection consumes memory.\n\n### Mitigation\n- Enable connection pooling (PgBouncer, RDS Proxy, application pool).\n- Fix connection leaks in application code.\n- Increase `max_connections` only if memory allows; prefer pooling first." | ||
| "blob": "## Database Connections High\n\n### Triage\n1. Compare average connections to the engine `max_connections` setting (not in CloudWatch).\n2. Check for connection leaks — idle sessions accumulating over time.\n3. Review application deploys or traffic spikes that increased connection demand.\n4. Inspect `FreeableMemory` — each connection consumes memory.\n\n### Mitigation\n- Enable connection pooling (PgBouncer, RDS Proxy, application pool).\n- Fix connection leaks in application code.\n- Increase `max_connections` only if memory allows; prefer pooling first." |
There was a problem hiding this comment.
The places where we are using avg, max of a metric are similar to the aggregation we are using in dashboards for those metrics ?
There was a problem hiding this comment.
Yeah. most of the metrics match have same aggregation function but we have some discrepancies. I did base the aggregation function in alerts on this resource https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Best_Practice_Recommended_Alarms_AWS_Services.html
There was a problem hiding this comment.
Pull request overview
Updates multiple AWS OpenTelemetry “content-only” integration packages to better align alert/SLO aggregations and calculations with AWS recommended CloudWatch alarm guidance, and links SLO templates back to their overview dashboards.
Changes:
- Bump package versions to
0.4.0and add correspondingchangelog.ymlentries. - AWS SQS OTel: replace the “backlog growth” alert with a “high backlog” alert and update DLQ matching to
*dlq*across relevant alerts/SLOs. - Link several SLO templates (SQS/RDS/Lambda/ELB/EC2) to their package dashboards; add guard filters to avoid divide-by-zero in ratio SLOs.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/aws_sqs_otel/manifest.yml | Version bump to 0.4.0. |
| packages/aws_sqs_otel/kibana/slo_template/aws_sqs_otel-oldest-message-age-99.5-Rolling30Days.json | Add dashboard artifact link. |
| packages/aws_sqs_otel/kibana/slo_template/aws_sqs_otel-dlq-empty-99.5-Rolling30Days.json | Add dashboard artifact link. |
| packages/aws_sqs_otel/kibana/alerting_rule_template/aws_sqs_otel-oldest-message-age-high.json | Update DLQ exclusion pattern to *dlq*. |
| packages/aws_sqs_otel/kibana/alerting_rule_template/aws_sqs_otel-in-flight-saturation.json | Switch to Average/AVG aggregation and align DLQ exclusion pattern. |
| packages/aws_sqs_otel/kibana/alerting_rule_template/aws_sqs_otel-dlq-messages-present.json | Update DLQ inclusion pattern to *dlq* and adjust guidance text. |
| packages/aws_sqs_otel/kibana/alerting_rule_template/aws_sqs_otel-high-backlog.json | Add new sustained high-backlog alert template. |
| packages/aws_sqs_otel/kibana/alerting_rule_template/aws_sqs_otel-backlog-growth.json | Remove backlog-growth alert template. |
| packages/aws_sqs_otel/docs/README.md | Update alert template list to reflect high-backlog replacement. |
| packages/aws_sqs_otel/changelog.yml | Add 0.4.0 entry describing alert/aggregation updates. |
| packages/aws_rds_otel/manifest.yml | Version bump to 0.4.0. |
| packages/aws_rds_otel/kibana/slo_template/aws_rds_otel-avg-read-latency-99.5-Rolling30Days.json | Add dashboard artifact link. |
| packages/aws_rds_otel/kibana/alerting_rule_template/aws_rds_otel-database-connections-high.json | Switch to Average/AVG aggregation and update messaging accordingly. |
| packages/aws_rds_otel/changelog.yml | Add 0.4.0 entry for aggregation change. |
| packages/aws_lambda_otel/manifest.yml | Version bump to 0.4.0. |
| packages/aws_lambda_otel/kibana/slo_template/aws_lambda_otel-invocation-success-rate-99.5-Rolling30Days.json | Add denominator > 0 filter and dashboard artifact link. |
| packages/aws_lambda_otel/kibana/slo_template/aws_lambda_otel-avg-duration-99.5-Rolling30Days.json | Add dashboard artifact link. |
| packages/aws_lambda_otel/changelog.yml | Add 0.4.0 entry for aggregation/div-by-zero guard update. |
| packages/aws_elb_metrics_otel/manifest.yml | Version bump to 0.4.0. |
| packages/aws_elb_metrics_otel/kibana/slo_template/aws_elb_metrics_otel-target-response-time-avg-99.5-Rolling30Days.json | Add dashboard artifact link. |
| packages/aws_elb_metrics_otel/kibana/slo_template/aws_elb_metrics_otel-request-availability-99.5-Rolling30Days.json | Add denominator > 0 filter and dashboard artifact link. |
| packages/aws_elb_metrics_otel/changelog.yml | Add 0.4.0 entry for aggregation/div-by-zero guard update. |
| packages/aws_ec2_otel/manifest.yml | Version bump to 0.4.0. |
| packages/aws_ec2_otel/kibana/slo_template/aws_ec2_otel-status-check-availability-99.5-Rolling30Days.json | Add dashboard artifact link. |
| packages/aws_ec2_otel/changelog.yml | Add 0.4.0 entry for dashboard linkage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ], | ||
| "artifacts": { | ||
| "dashboards": [ | ||
| { "id": "aws_ec2_otel-45f45575-d519-4a70-a50c-2195c0c9f916" } |
There was a problem hiding this comment.
Hoping these id;s stay the same as the updates on the dashboards are ongoing.
| "searchType": "esqlQuery", | ||
| "esqlQuery": { | ||
| "esql": "FROM metrics-aws.rds.otel-*\n| WHERE Namespace == \"AWS/RDS\"\n AND MetricName == \"DatabaseConnections\"\n AND stat == \"Maximum\"\n| STATS max_connections = MAX(`metrics.amazonaws.com/AWS/RDS/DatabaseConnections`)\n BY DBInstanceIdentifier, cloud.region\n// Peak connection count — set relative to max_connections and baseline (default: 100)\n| WHERE max_connections > 100\n| SORT max_connections DESC" | ||
| "esql": "FROM metrics-aws.rds.otel-*\n| WHERE Namespace == \"AWS/RDS\"\n AND MetricName == \"DatabaseConnections\"\n AND stat == \"Average\"\n| STATS avg_connections = AVG(`metrics.amazonaws.com/AWS/RDS/DatabaseConnections`)\n BY DBInstanceIdentifier, cloud.region\n// Average connection count — set relative to max_connections and baseline (default: 100)\n| WHERE avg_connections > 100\n| SORT avg_connections DESC" |
There was a problem hiding this comment.
Was this change as per what we are using for dashboards. ?
Are we collecting both but using average for the database connections ?
Do we have a reasoning for which aggregation ispreferred when ?
There was a problem hiding this comment.
@ishleenk17 reason for the change was to match aggregation recommended by the AWS documentation
Dashboards are using MAX:
"esql": "FROM metrics-aws.rds.otel-* | WHERE LENGTH(TO_STRING(DBInstanceIdentifier)) > 0
| WHERE stat == \"Maximum\"
| STATS total_conn = MAX(CASE(stat == \"Maximum\", `metrics.amazonaws.com/AWS/RDS/DatabaseConnections`, NULL))"
kibana/dashboard/aws_rds_otel-c92e1216-83f6-4de7-9d7f-1bcb42d5988a.json
There was a problem hiding this comment.
In this case I used AVG instead of MAX to avoid alerting on single spikes, and instead alert on sustained connection saturation.
|
Recommendation: For the ELB, as the alerts are configured for the ALB, it would be best to add "Application Load Balancer" or similar in the title itself. Presently, it is [AWS ELB OTel], and the "Application Load Balancer" appears in the description. Kindly check the experience when the alert is triggered. |
|
Can these be |
|
@agithomas here are the alarms and SLOs being triggered
|
@agithomas we could use |
|
Tick the box to add this pull request to the merge queue (same as
|
| "artifacts": { | ||
| "investigation_guide": { | ||
| "blob": "## In-Flight Saturation\n\n`ApproximateNumberOfMessagesNotVisible` counts messages received but not yet deleted (hidden by visibility timeout). Standard queues cap in-flight messages at ~120,000; approaching this limit blocks new deliveries.\n\n### Triage Steps\n1. Check whether consumers are deleting messages — compare `NumberOfMessagesDeleted` to `NumberOfMessagesReceived`.\n2. Look for stuck or crashed consumers holding messages until visibility timeout expires.\n3. Verify visibility timeout is not excessively long relative to processing time.\n4. Inspect consumer error rates — are messages failing without being deleted or sent to a DLQ?\n5. Consider scaling consumers or reducing batch receive sizes if processing is slow.\n\n### Customisation\n- Tune the `in_flight > 100000` threshold (~83% of the ~120k standard-queue limit).\n- FIFO queues have different in-flight limits — adjust threshold per queue type if needed.\n- This rule uses `Maximum` stat to catch peak in-flight during the window." | ||
| "blob": "## In-Flight Saturation\n\n`ApproximateNumberOfMessagesNotVisible` counts messages received but not yet deleted (hidden by visibility timeout). Standard queues cap in-flight messages at ~120,000; approaching this limit blocks new deliveries.\n\n### Triage Steps\n1. Check whether consumers are deleting messages — compare `NumberOfMessagesDeleted` to `NumberOfMessagesReceived`.\n2. Look for stuck or crashed consumers holding messages until visibility timeout expires.\n3. Verify visibility timeout is not excessively long relative to processing time.\n4. Inspect consumer error rates — are messages failing without being deleted or sent to a DLQ?\n5. Consider scaling consumers or reducing batch receive sizes if processing is slow.\n\n### Customisation\n- Tune the `in_flight > 100000` threshold (~83% of the ~120k standard-queue limit).\n- FIFO queues have different in-flight limits — adjust threshold per queue type if needed.\n- This rule uses the `Average` stat, per AWS recommended alarms for `ApproximateNumberOfMessagesNotVisible`." |
There was a problem hiding this comment.
nit: When the threshold (10,000) is customisable, it would be best not to mention static threshold values in the investigation guide.
| "artifacts": { | ||
| "investigation_guide": { | ||
| "blob": "## DLQ Has Messages\n\nAny message in a dead-letter queue means the pipeline dropped work after exceeding `maxReceiveCount` on the source queue.\n\n### Triage Steps\n1. Identify the source queue (DLQ name usually mirrors the primary queue, e.g. `orders-dlq` → `orders`).\n2. Inspect DLQ messages in the AWS console or via `ReceiveMessage` to find poison payloads or recurring error patterns.\n3. Check consumer logs and error rates for the service that processes the source queue.\n4. Verify redrive policy and `maxReceiveCount` are configured as expected.\n5. After fixing the root cause, redrive or manually reprocess DLQ messages.\n\n### Customisation\n- Tune the `LIKE \"*-dlq\"` pattern in the ES|QL query to match your DLQ naming convention (e.g. `*deadletter*`).\n- Threshold is `> 0` by design — even one DLQ message is actionable." | ||
| "blob": "## DLQ Has Messages\n\nAny message in a dead-letter queue means the pipeline dropped work after exceeding `maxReceiveCount` on the source queue.\n\n### Triage Steps\n1. Identify the source queue (DLQ name usually mirrors the primary queue, e.g. `orders-dlq` → `orders`).\n2. Inspect DLQ messages in the AWS console or via `ReceiveMessage` to find poison payloads or recurring error patterns.\n3. Check consumer logs and error rates for the service that processes the source queue.\n4. Verify redrive policy and `maxReceiveCount` are configured as expected.\n5. After fixing the root cause, redrive or manually reprocess DLQ messages.\n\n### Customisation\n- Tune the `LIKE \"*dlq*\"` pattern in the ES|QL query to match your DLQ naming convention (e.g. `*deadletter*`). This matches the `QueueName: *dlq*` filter used by the DLQ-empty SLO so the two stay consistent.\n- Threshold is `> 0` by design — even one DLQ message is actionable." |
There was a problem hiding this comment.
This matches the
QueueName: *dlq*filter used by the DLQ-empty SLO so the two stay consistent.
nit: Is this aspect relevant enough, if the user chose to install only the alerts? Revisit .
|
✅ All changelog entries have the correct PR link. |
💚 Build Succeeded
History
|
|
Package aws_ec2_otel - 0.4.0 containing this change is available at https://epr.elastic.co/package/aws_ec2_otel/0.4.0/ |
|
Package aws_elb_metrics_otel - 0.4.0 containing this change is available at https://epr.elastic.co/package/aws_elb_metrics_otel/0.4.0/ |
|
Package aws_lambda_otel - 0.4.0 containing this change is available at https://epr.elastic.co/package/aws_lambda_otel/0.4.0/ |
|
Package aws_rds_otel - 0.4.0 containing this change is available at https://epr.elastic.co/package/aws_rds_otel/0.4.0/ |
|
Package aws_sqs_otel - 0.4.0 containing this change is available at https://epr.elastic.co/package/aws_sqs_otel/0.4.0/ |

Proposed commit message
Update assets to match AWS guide https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Best_Practice_Recommended_Alarms_AWS_Services.html
Checklist
changelog.ymlfile.Author's Checklist
How to test this PR locally
Related issues
Screenshots