Links#
1. YACE Config#
apiVersion: v1alpha1
sts-region: ap-northeast-1
discovery:
jobs:
- type: AWS/ECS
regions: [ap-northeast-1]
customTags:
- key: environment
value: uat
period: 300
length: 600
nilToZero: true
metrics:
- name: CPUUtilization
statistics: [Average]
- name: MemoryUtilization
statistics: [Average]
- type: ECS/ContainerInsights
regions: [ap-northeast-1]
customTags:
- key: environment
value: uat
period: 300
length: 600
nilToZero: true
metrics:
- name: RunningTaskCount
statistics: [Average]
- name: DesiredTaskCount
statistics: [Average]
- name: PendingTaskCount
statistics: [Average]Dashboard 选择:
aws-ecs-service-yace-overview-dashboard.json:
使用 $dimension_ServiceName 过滤。
适合单一环境,或者同一个 Prometheus 里只有一个环境的 ECS metrics。
aws-ecs-service-yace-env-overview-dashboard.json:
使用 $environment + $dimension_ServiceName 过滤。
适合同一个 Prometheus / VictoriaMetrics 里同时存在 uat、prod 等多个环境的 ECS metrics。2. Dashboard Rows#
| Row | Panels |
|---|---|
| Service Health | running vs desired tasks, CPU, memory, pending task count |
| Scaling Signals | running / desired / pending by service, CPU / memory trend, desired-running gap with pending |
Why only 2 rows:
ECS service 原生 metrics 不多。
如果没有接入 ALB request/error/latency 和应用 Prometheus metrics,拆成 4 层通常只会重复展示 task count、CPU、memory。
所以这个 dashboard 收缩成两行更实用:
Service Health:
先看服务是不是在正常运行
Scaling Signals:
再看是不是扩容策略、deployment、capacity provider 出了问题Trend note:
CPU / Memory Trend 不是原始单点值。
当前使用最近 1 小时 rolling average,
用来判断长期资源水位,而不是看短时间 spike。Metric availability note:
AWS/ECS:
CPUUtilization
MemoryUtilization
ECS/ContainerInsights:
RunningTaskCount
DesiredTaskCount
PendingTaskCount
如果要让 dashboard 里的 task count / pending panel 有数据,
需要同时采这两个 namespace。
label note:
current dashboard uses YACE labels like:
dimension_ClusterName
dimension_ServiceName
metric note:
standard ECS metrics:
aws_ecs_cpuutilization_average
aws_ecs_memory_utilization_average
Container Insights metrics:
aws_ecs_containerinsights_running_task_count_average
aws_ecs_containerinsights_desired_task_count_average
aws_ecs_containerinsights_pending_task_count_average3. Request / Error / Latency#
ECS namespace 不提供完整 request / error / latency。
HTTP service behind ALB:
use AWS/ApplicationELB metrics
RequestCount
HTTPCode_Target_5XX_Count
HTTPCode_ELB_5XX_Count
TargetResponseTime
application-level view:
use app Prometheus metrics
http_requests_total
http_request_duration_seconds
error counter by route / status / exception4. Verify#
{__name__=~"aws_ecs_.*"}
{__name__=~"aws_ecs_containerinsights_.*"}