- Newest
- Most votes
- Most comments
This appears to be an issue with how you're querying the CloudWatch metrics for your target groups. When retrieving metrics for Application Load Balancer target groups, you need to specify both the LoadBalancer and TargetGroup dimensions together, not just the TargetGroup dimension alone.
CloudWatch treats each unique combination of dimensions as a separate metric, and you must specify the exact same dimensions that were used when the metrics were created. For ALB target group metrics, both dimensions are required:
- Name=LoadBalancer,Value=app/my-alb/1234567890abcdef
- Name=TargetGroup,Value=targetgroup/my-tg-deals/1234567890abcdef
Try modifying your CloudWatch query to include both dimensions:
aws cloudwatch get-metric-statistics --namespace "AWS/ApplicationELB" \
--metric-name "RequestCount" \
--dimensions Name=LoadBalancer,Value=app/my-alb/1234567890abcdef \
Name=TargetGroup,Value=targetgroup/my-tg-deals/1234567890abcdef \
--start-time [timestamp] --end-time [timestamp] --period 3600 --statistics Sum
This should return the target group metrics you're looking for. The issue isn't that the metrics aren't being published, but rather that you're not querying them with the complete set of required dimensions.
Sources
CloudWatch metrics for your Gateway Load Balancer - Elastic Load Balancing
CloudWatch metrics for your Network Load Balancer - Elastic Load Balancing
answered a year ago
Relevant content
asked 2 years ago
