Grafana ALB Dashboards

本文缩写(英文全称与中文含义)
缩写 英文全称/名称 中文含义
ALB Application Load Balancer 应用负载均衡器
AWS Amazon Web Services 亚马逊云服务
AZ Availability Zone 可用区
ECS Elastic Container Service AWS 容器编排服务
gRPC gRPC Remote Procedure Calls 基于 HTTP/2 的远程过程调用框架
LCU Load Balancer Capacity Unit 负载均衡器容量单位
SG Security Group 安全组
TLS Transport Layer Security 传输层安全协议
YACE Yet Another CloudWatch Exporter 把 CloudWatch 指标转换为 Prometheus 指标的采集器

1. Dashboard Rule#

Folder: Traffic
Dashboard: ALB - Overview

Rows:
    Overview:
        request、target health、5xx、latency、connection failure

    Drilldown:
        按 load balancer / target group / target / status code 拆开看

    Capacity:
        request growth、LCU 相关趋势、healthy target 变化

    Debug:
        TLS、rule、redirect、connection-level 细节,不放第一屏;排查 ALB 行为异常时查看

2. Overview#

Panel Metrics Why
Request rate RequestCount traffic 基线
Healthy targets HealthyHostCount, UnHealthyHostCount ALB 后端是否可用
Target 5xx HTTPCode_Target_5XX_Count 应用或 target 失败
ALB 5xx HTTPCode_ELB_5XX_Count load balancer 层失败
Target latency TargetResponseTime p95/p99 后端响应慢会直接影响用户
Connection errors TargetConnectionErrorCount, RejectedConnectionCount target connection / capacity 问题

ALB metric dimension:

LoadBalancer:
    整个 ALB 维度。
    适合看总流量、总错误、总连接、总带宽。

TargetGroup:
    target group 维度。
    适合看某个 ECS service / backend service 的健康、5xx、latency。

AvailabilityZone:
    AZ 维度。
    适合排查单 AZ 异常。

TargetGroup + LoadBalancer:
    最常用的服务视角。
    ECS service behind ALB 时,request / error / latency 推荐按这个维度看。

实践选择:

看整个入口:
    LoadBalancer dimension

看某个服务:
    TargetGroup + LoadBalancer dimension

看后端健康:
    HealthyHostCount / UnHealthyHostCount by target group

看应用错误:
    HTTPCode_Target_5XX_Count by target group

看 ALB 自身错误:
    HTTPCode_ELB_5XX_Count by load balancer

3. Drilldown#

Panel Metrics Why
Status code split HTTPCode_Target_2XX/3XX/4XX/5XX_Count 区分正常、客户端错误、服务端错误
Target group health HealthyHostCount, UnHealthyHostCount by target group 找到异常 target group
Latency by target group TargetResponseTime by target group 找到慢服务
Target connection errors TargetConnectionErrorCount 排查 target port / SG / overload
Fixed response / redirect HTTP_Fixed_Response_Count, HTTP_Redirect_Count rule 行为异常时使用

4. Capacity#

Panel Metrics Why
Request trend RequestCount 业务增长和扩容依据
Active connections ActiveConnectionCount 连接压力
New connections NewConnectionCount 突发连接压力
Processed bytes ProcessedBytes 带宽趋势
LCU signals LCU related CloudWatch metrics if enabled ALB 成本和容量判断

5. Debug#

Panel Metrics Why
TLS negotiation errors TLS related ALB metrics if used 排查 client TLS 兼容问题
Rule evaluations RuleEvaluations 复杂 listener rules 成本和行为分析
Auth metrics ALB auth metrics if used 只有启用 ALB authentication 时展示
gRPC status gRPC target status metrics if used 只有 gRPC workload 需要

6. YACE Metrics#

如果 ALB dashboard 使用 aws_applicationelb_* metrics,需要 YACE 采集 AWS/ApplicationELB。目标组维度通常依赖 load_balancer / target_group labels。

YACE config:

apiVersion: v1alpha1
sts-region: ap-northeast-1
discovery:
  jobs:
    - type: AWS/ApplicationELB
      regions:
        - ap-northeast-1
      customTags:
        - key: environment
          value: uat
      period: 300
      length: 600
      nilToZero: true
      metrics:
        - name: RequestCount
          statistics: [Sum]
        - name: HealthyHostCount
          statistics: [Minimum]
        - name: UnHealthyHostCount
          statistics: [Maximum]
        - name: HTTPCode_Target_2XX_Count
          statistics: [Sum]
        - name: HTTPCode_Target_3XX_Count
          statistics: [Sum]
        - name: HTTPCode_Target_4XX_Count
          statistics: [Sum]
        - name: HTTPCode_Target_5XX_Count
          statistics: [Sum]
        - name: HTTPCode_ELB_5XX_Count
          statistics: [Sum]
        - name: TargetResponseTime
          statistics: [Average, p95, p99]
        - name: TargetConnectionErrorCount
          statistics: [Sum]
        - name: RejectedConnectionCount
          statistics: [Sum]
        - name: ActiveConnectionCount
          statistics: [Sum]
        - name: NewConnectionCount
          statistics: [Sum]
        - name: ProcessedBytes
          statistics: [Sum]
        - name: RuleEvaluations
          statistics: [Sum]

确认 metric name:

{__name__=~"aws_applicationelb_.*"}

7. Do Not Put In Overview#

ALB Overview 优先展示请求量、target health、target 5xx 和延迟;ELB 5xx 与 target 5xx 分开归因,不把底层调试细节挤进第一屏。

不要放:
    listener rule 细节
    auth / gRPC / TLS 全量指标
    每个 target 的所有 low-level connection counters

原因:
    ALB overview 重点是 traffic、target health、error、latency

搜索文档

输入关键词,搜索所有文档。

↑ ↓ 选择 · Enter 打开 · Esc 关闭