Skip to content

feat: ALB metrics publishing to CloudWatch and Datadog#166

Merged
pilundain merged 11 commits intobetafrom
feature/alb-metrics-publishing
Apr 10, 2026
Merged

feat: ALB metrics publishing to CloudWatch and Datadog#166
pilundain merged 11 commits intobetafrom
feature/alb-metrics-publishing

Conversation

@pilundain
Copy link
Copy Markdown
Contributor

Summary

  • Add publish_alb_metrics script that publishes ALB rule count and target group count as custom metrics to CloudWatch (nullplatform/ApplicationELB) or Datadog (nullplatform.applicationelb.*)
  • Integrate as post-deploy step in initial, switch_traffic, and finalize workflows
  • Add ALB_METRICS_PUBLISH_ENABLED and ALB_METRICS_PUBLISH_TARGET configuration
  • Add scope-testing submodule and 17 BATS unit tests

Motivation

AWS ALBs have hard limits (100 rules, 100 target groups per ALB) that are not tracked natively by CloudWatch or Datadog. This enables continuous monitoring and alerting before limits are hit.

Configuration

ALB_METRICS_PUBLISH_ENABLED: true
ALB_METRICS_PUBLISH_TARGET: cloudwatch  # or datadog

Test plan

  • 17 BATS unit tests passing (bats k8s/deployment/tests/scripts/publish_alb_metrics.bats)
  • Verified CloudWatch metrics published to nullplatform/ApplicationELB namespace in kwik-e-mart account
  • Verified CloudWatch alarms trigger correctly on threshold breach

Pablo Ilundain added 8 commits April 9, 2026 09:10
Publish ALB rule count and target group count as custom metrics
after each deployment to enable continuous monitoring and alerting
on ALB quota usage.

- Add publish_alb_metrics script supporting CloudWatch and Datadog
- Integrate as post-deploy step in initial, switch_traffic, and finalize workflows
- Add ALB_METRICS_PUBLISH_ENABLED and ALB_METRICS_PUBLISH_TARGET config
- Add .claude/settings.local.json to .gitignore
- CloudWatch: nullplatform/ApplicationELB (mirrors AWS/ApplicationELB)
- Datadog: nullplatform.applicationelb.* (mirrors aws.applicationelb.*)
Metrics publishing now only depends on ALB_METRICS_PUBLISH_ENABLED
Move publish_alb_metrics step right after verify_networking_reconciliation
so metrics reflect sooner instead of waiting for pods to be ready.
Single line on success, single line on error, silent when disabled.
- Add scope-testing submodule
- Add 17 unit tests covering CloudWatch, Datadog, error handling,
  skip logic, and rule counting across multiple listeners
Keep both ALB capacity validation from beta and metrics publishing.
Comment thread .gitmodules Outdated
Comment thread k8s/deployment/publish_alb_metrics Outdated
Comment thread k8s/deployment/publish_alb_metrics Outdated
Pablo Ilundain added 3 commits April 10, 2026 10:22
Support reading ALB_METRICS_PUBLISH_ENABLED and ALB_METRICS_PUBLISH_TARGET
from scope-configurations provider, env vars, or defaults.
@pilundain pilundain merged commit 87bc38d into beta Apr 10, 2026
3 checks passed
@pilundain pilundain deleted the feature/alb-metrics-publishing branch April 10, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants