Skip to content

[aws_otel] Improve ESQL queries - #19799

Merged
mykola-elastic merged 33 commits into
elastic:mainfrom
mrg-elastic:aws-queries-improvements-2
Jun 29, 2026
Merged

[aws_otel] Improve ESQL queries#19799
mykola-elastic merged 33 commits into
elastic:mainfrom
mrg-elastic:aws-queries-improvements-2

Conversation

@mrg-elastic

Copy link
Copy Markdown
Contributor

Proposed commit message

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@github-actions

Copy link
Copy Markdown
Contributor

TL;DR

Buildkite never reached package tests: the repository post-checkout hook failed while merging PR 19799 with main. The conflicts are the version/changelog entries for aws_ecs_otel, aws_rds_otel, and aws_sqs_otel.

Remediation

  • Rebase or merge main into the PR branch and resolve these files: packages/aws_ecs_otel/{manifest.yml,changelog.yml}, packages/aws_rds_otel/{manifest.yml,changelog.yml}, and packages/aws_sqs_otel/{manifest.yml,changelog.yml}.
  • Keep the new main changelog entries from PR 19797, then add this PR's entry above them with versions higher than main's current manifests: likely aws_ecs_otel 0.5.1, aws_rds_otel 0.6.1, and aws_sqs_otel 0.6.1. Also replace the placeholder changelog link /pull/999 with /pull/19799.
  • Validate by confirming git merge origin/main or the rebase completes without conflicts, then push so Buildkite can get past the pipeline upload step.
Investigation details

Root Cause

This is a merge conflict, not a test failure. The PR changes package versions from older base values (aws_ecs_otel 0.4.0 -> 0.4.1, aws_rds_otel 0.5.0 -> 0.5.1, aws_sqs_otel 0.5.0 -> 0.5.1), but current main already contains newer package metadata:

Package main manifest PR manifest Conflict source
aws_ecs_otel 0.5.0 at packages/aws_ecs_otel/manifest.yml:4 0.4.1 manifest/changelog both changed at top
aws_rds_otel 0.6.0 at packages/aws_rds_otel/manifest.yml:4 0.5.1 manifest/changelog both changed at top
aws_sqs_otel 0.6.0 at packages/aws_sqs_otel/manifest.yml:4 0.5.1 manifest/changelog both changed at top

main also has new top changelog entries from PR 19797 at packages/aws_ecs_otel/changelog.yml:2, packages/aws_rds_otel/changelog.yml:2, and packages/aws_sqs_otel/changelog.yml:2, while this PR adds different top entries in the same locations.

Evidence

Auto-merging packages/aws_ecs_otel/changelog.yml
CONFLICT (content): Merge conflict in packages/aws_ecs_otel/changelog.yml
Auto-merging packages/aws_ecs_otel/manifest.yml
CONFLICT (content): Merge conflict in packages/aws_ecs_otel/manifest.yml
Auto-merging packages/aws_rds_otel/changelog.yml
CONFLICT (content): Merge conflict in packages/aws_rds_otel/changelog.yml
Auto-merging packages/aws_rds_otel/manifest.yml
CONFLICT (content): Merge conflict in packages/aws_rds_otel/manifest.yml
Auto-merging packages/aws_sqs_otel/changelog.yml
CONFLICT (content): Merge conflict in packages/aws_sqs_otel/changelog.yml
Auto-merging packages/aws_sqs_otel/manifest.yml
CONFLICT (content): Merge conflict in packages/aws_sqs_otel/manifest.yml
Automatic merge failed; fix conflicts and then commit the result.
Merge failed: 1

Verification

  • Not run locally; the failure occurs before the Buildkite pipeline upload completes, and the logs identify the exact merge-conflicting files.

What is this? | From workflow: PR Buildkite Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@github-actions

Copy link
Copy Markdown
Contributor

✅ 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates AWS OpenTelemetry integration assets by refining several Kibana dashboard ESQL queries (primarily for SQS and RDS) and bumping package versions with corresponding changelog entries.

Changes:

  • Updated SQS and RDS dashboard panels to use revised ESQL patterns (e.g., TS pipelines, *_over_time functions, and explicit freshness filtering for “latest” state).
  • Bumped package versions for aws_sqs_otel (0.6.0 → 0.6.1), aws_rds_otel (0.6.0 → 0.6.1), and aws_ecs_otel (0.5.0 → 0.5.1).
  • Added changelog entries describing the dashboard query improvements.

Reviewed changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/aws_sqs_otel/manifest.yml Bumps SQS OTEL package version to 0.6.1.
packages/aws_sqs_otel/kibana/dashboard/aws_sqs_otel-b1c3d401-841f-43f1-9421-4afc51a2ec87.json Updates multiple SQS dashboard panels’ ESQL queries and embedded Vega spec query logic.
packages/aws_sqs_otel/changelog.yml Adds 0.6.1 changelog entry for the SQS dashboard query changes.
packages/aws_rds_otel/manifest.yml Bumps RDS OTEL package version to 0.6.1.
packages/aws_rds_otel/kibana/dashboard/aws_rds_otel-c92e1216-83f6-4de7-9d7f-1bcb42d5988a.json Updates multiple RDS dashboard panels’ ESQL queries and embedded Vega spec query logic (including “freshness” filtering).
packages/aws_rds_otel/changelog.yml Adds 0.6.1 changelog entry for the RDS dashboard query changes.
packages/aws_ecs_otel/manifest.yml Bumps ECS OTEL package version to 0.5.1.
packages/aws_ecs_otel/changelog.yml Adds 0.5.1 changelog entry (currently inconsistent with the actual changes in this PR for ECS).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/aws_ecs_otel/changelog.yml Outdated
@andrewkroh andrewkroh added Integration:aws_sqs_otel AWS SQS Metrics OpenTelemetry Assets dashboard Relates to a Kibana dashboard bug, enhancement, or modification. Integration:aws_ecs_otel AWS ECS Metrics OpenTelemetry Assets Integration:aws_rds_otel AWS RDS Metrics OpenTelemetry Assets Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] labels Jun 26, 2026
mykola-elastic and others added 3 commits June 29, 2026 12:18
The RDS/SQS/ECS status hexmaps classified resource status using a
different aggregation than the "by status" donut and KPI panels, so the
hexmap and overview counts could disagree:

- RDS: hexmap classified low-storage from the Maximum FreeStorageSpace
  statistic (and last sample) while the overview used the Minimum
  statistic over the window. Switched the hexmap to a window-MIN of the
  Minimum statistic, aligned CPU/connections to window-MAX of Maximum,
  and matched the 5-minute staleness window.
- SQS: hexmap classified stale from the Average AgeOfOldestMessage
  statistic; switched to Maximum to match the overview.
- ECS: hexmap, worst-first table and status-over-time classified from
  window-max while the overview used the last sample. Switched these to
  last-of-Maximum and unified the idle/healthy thresholds with the donut.

Verified: all dashboard ES|QL queries execute against a live cluster and
hexmap status counts now match the donut/KPI counts per package.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The SQS and ECS status hexmap Vega-embedded ESQL queries started with
FROM ... but, unlike every other ESQL panel in those dashboards (and the
RDS hexmap), did not set `unmapped_fields = "nullify"`. On partially
mapped index patterns this can fail at runtime with unmapped-field
errors. Prefixed both raw_all queries to match the existing convention;
the ts_probe ROW queries reference no fields and are left untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@mykola-elastic mykola-elastic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, review comments resolved + manually tested in stack with data

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

The EC2 and ELB status hexmaps disagreed with their "by status" donut and
KPI panels:

- Both hexmaps lacked the recently-active staleness filter the overview
  panels apply (DATE_DIFF("minutes", last_seen, latest_global) <= 5), so
  the hexmaps counted entities that had stopped reporting earlier in the
  range. Added the same filter to both hexmap raw_all queries.
- EC2: the overview panels classify an instance with no StatusCheckFailed
  data as "healthy", while the hexmap classified it as "no data". Aligned
  the hexmap to the overview (NULL StatusCheckFailed -> healthy).

aws_lambda_otel was reviewed too and is already consistent (no change).

Verified: hexmap status counts now match the donut/KPI counts per package
against a live cluster (EC2 41=41, ELB 2=2); elastic-package lint passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mykola-elastic mykola-elastic added Integration:aws_elb_metrics_otel AWS ELB Metrics OpenTelemetry Assets Integration:aws_ec2_otel AWS EC2 Metrics OpenTelemetry Assets labels Jun 29, 2026
mykola-elastic and others added 2 commits June 29, 2026 14:00
Convert the status-hexmap raw_all ESQL from FROM to the TS time-series
command across all six AWS OTel packages (rds, sqs, ecs, ec2, elb,
lambda), consistent with the dashboards' other time-series panels. Each
aggregation is expressed in its *_over_time form
(MAX->MAX(MAX_OVER_TIME(...)), LAST(x,@timestamp)->MAX(LAST_OVER_TIME(x)),
etc.); the redundant per-aggregation WHERE ... IS NOT NULL guards are
dropped (CASE already nullifies non-matching stats).

Besides the idiom alignment, TS corrects the per-series "last value"
computation: FROM's LAST(CASE(...), @timestamp) could pick the wrong
value when an entity has multiple stat series. This notably fixes the
SQS hexmap, which previously disagreed with its donut (a stale queue was
mis-classified idle); the TS hexmap now matches the donut exactly.

Verified against a live cluster: all dashboard ES|QL queries execute
(138/138), and hexmap status counts match the donut/KPI counts per
package. Only aws_lambda_otel needed a version bump + changelog entry
(newly joining the PR); the other five already carry their elastic#19799 entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Lambda status hexmap grouped only BY FunctionName, while its "by
status" donut/KPI panels (and every other package's hexmap) group BY
FunctionName, cloud.region. With a function reporting from more than one
region the donut would count it per-region but the hexmap would collapse
it to one hexagon. Added cloud.region to the hexmap grouping so the two
stay consistent.

Verified against a live cluster: all dashboard queries execute and the
hexmap status counts match the donut counts over the same time window.
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@mykola-elastic mykola-elastic added the Integration:aws_lambda_otel AWS Lambda Metrics OpenTelemetry Assets label Jun 29, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@agithomas agithomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mergify

mergify Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request
@mykola-elastic
mykola-elastic merged commit 76c81b7 into elastic:main Jun 29, 2026
11 checks passed
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package aws_ec2_otel - 0.7.0 containing this change is available at https://epr.elastic.co/package/aws_ec2_otel/0.7.0/

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package aws_ecs_otel - 0.6.0 containing this change is available at https://epr.elastic.co/package/aws_ecs_otel/0.6.0/

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package aws_elb_metrics_otel - 0.7.0 containing this change is available at https://epr.elastic.co/package/aws_elb_metrics_otel/0.7.0/

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package aws_lambda_otel - 0.7.0 containing this change is available at https://epr.elastic.co/package/aws_lambda_otel/0.7.0/

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package aws_rds_otel - 0.7.0 containing this change is available at https://epr.elastic.co/package/aws_rds_otel/0.7.0/

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package aws_sqs_otel - 0.7.0 containing this change is available at https://epr.elastic.co/package/aws_sqs_otel/0.7.0/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dashboard Relates to a Kibana dashboard bug, enhancement, or modification. Integration:aws_ec2_otel AWS EC2 Metrics OpenTelemetry Assets Integration:aws_ecs_otel AWS ECS Metrics OpenTelemetry Assets Integration:aws_elb_metrics_otel AWS ELB Metrics OpenTelemetry Assets Integration:aws_lambda_otel AWS Lambda Metrics OpenTelemetry Assets Integration:aws_rds_otel AWS RDS Metrics OpenTelemetry Assets Integration:aws_sqs_otel AWS SQS Metrics OpenTelemetry Assets Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations]

6 participants