[aws] elb_metrics: collect Application ELB HTTPCode_Target_* metrics - #20609
[aws] elb_metrics: collect Application ELB HTTPCode_Target_* metrics#20609shmsr wants to merge 7 commits into
Conversation
Application ELB was only collecting HTTPCode_ELB_* metrics. Add
HTTPCode_Target_{2,3,4,5}XX_Count to the CloudWatch metric list and
field mappings, and map HealthyHostCount/UnHealthyHostCount that were
already collected. Add a system-test stack that generates in-VPC ALB
traffic so these metrics can be validated.
✅ 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. |
🚀 Benchmarks reportTo see the full report comment with |
Generate 2xx/3xx/4xx/5xx responses in the system-test fixture so all HTTPCode_Target_* metrics are exercised, and discover t3.micro AZs via instance-type offerings instead of hardcoding us-east-1 names.
Quote the systemd unit heredoc and inject the ALB DNS via sed so \$p is not expanded away at cloud-init time (which forced all traffic to /).
There was a problem hiding this comment.
Pull request overview
Adds missing Application ELB target response-code metrics, field mappings, documentation, and end-to-end test infrastructure.
Changes:
- Collects and maps
HTTPCode_Target_{2,3,4,5}XX_Countand host-health metrics. - Adds an ALB traffic-generation system test.
- Bumps AWS integration to 7.1.2.
Contributor tooling: /plugin install integration-skills@elastic-integration-skills
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/aws/manifest.yml |
Bumps package version. |
packages/aws/changelog.yml |
Records the metric additions. |
packages/aws/docs/elb.md |
Documents new fields. |
packages/aws/data_stream/elb_metrics/fields/fields.yml |
Defines metric mappings. |
packages/aws/data_stream/elb_metrics/agent/stream/stream.yml.hbs |
Requests target-code metrics. |
packages/aws/data_stream/elb_metrics/_dev/test/system/test-default-config.yml |
Configures the system test. |
packages/aws/data_stream/elb_metrics/_dev/deploy/tf/main.tf |
Provisions the ALB test environment. |
packages/aws/data_stream/elb_metrics/_dev/deploy/tf/variables.tf |
Defines deployment variables. |
packages/aws/data_stream/elb_metrics/_dev/deploy/tf/env.yml |
Passes AWS credentials and region. |
packages/aws/data_stream/elb_metrics/_dev/deploy/tf/.terraform.lock.hcl |
Locks the AWS provider. |
Files not reviewed (1)
- packages/aws/data_stream/elb_metrics/_dev/deploy/tf/.terraform.lock.hcl: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| internal = true | ||
| load_balancer_type = "application" | ||
| security_groups = [aws_security_group.alb.id] | ||
| subnets = slice(sort(data.aws_subnets.default.ids), 0, min(2, length(data.aws_subnets.default.ids))) |
💚 Build Succeeded
History
|
Align the ALB subnet selection with the AZ-qualified target subnet set so the test topology always routes through a target-enabled AZ, and require all four Target HTTP code fields in the system test so missing metrics fail verification.
|
✅ All changelog entries have the correct PR link. |
Proposed commit message
Application ELB
elb_metricspreviously collectedHTTPCode_ELB_*response-code metrics but not the target-generatedHTTPCode_Target_{2,3,4,5}XX_CountCloudWatch metrics, so target HTTP status counts were missing from ingested documents.Add those metrics to the Application ELB CloudWatch metric list and field mappings, map
HealthyHostCount/UnHealthyHostCountunderaws.applicationelb.metrics, bump the package to 7.1.2, regenerate ELB docs, and add anelb_metricssystem-test Terraform stack (internal ALB + target + in-VPC traffic client) so the metrics can be validated end-to-end.Checklist
changelog.ymlfile.Author's Checklist
HTTPCode_Target_*appear underaws.applicationelb.metricswhen Application ELB traffic reaches healthy targetsHow to test this PR locally
Verification notes
A fresh local system test passed for
aws/elb_metrics(PASS, exit0). During the run, Elasticsearch documents contained non-zero values for:aws.applicationelb.metrics.HTTPCode_Target_2XX_Count.sumaws.applicationelb.metrics.HTTPCode_Target_3XX_Count.sumaws.applicationelb.metrics.HTTPCode_Target_4XX_Count.sumaws.applicationelb.metrics.HTTPCode_Target_5XX_Count.sumThe generated ELB docs also include the new Target HTTP code metrics and the
HealthyHostCount/UnHealthyHostCountApplication ELB mappings.