---
version: v1
display_name: AWS ALB Target Health
namespace: AWS/ApplicationELB
query:
  period: 5m
# Narrow default target-group health profile. The broader alb_target profile stays disabled by
# default because it collects multiple per-target-group metrics; this profile collects only the
# AWS-recommended unhealthy-host statistic needed by stock health alerts.
instance:
  dimensions:
    - name: LoadBalancer
      label: load_balancer
    - name: TargetGroup
      label: target_group
metrics:
  - id: unhealthy_host_count
    metric_name: UnHealthyHostCount
    statistics: [minimum]
template:
  family: ALB Targets
  context_namespace: alb_target_health
  chart_defaults:
    instances:
      by_labels: [account_id, region, load_balancer, target_group]
  charts:
    - id: aws_cloudwatch_alb_target_health_unhealthy_hosts
      context: unhealthy_hosts
      title: ALB Target Group Unhealthy Hosts
      family: Hosts
      units: hosts
      algorithm: absolute
      dimensions:
        - selector: unhealthy_host_count_minimum
          name: unhealthy
