Links#
- Amazon RDS metrics
- PostgreSQL monitoring statistics
- Aurora PostgreSQL YACE dashboard JSON
- Aurora PostgreSQL YACE environment dashboard JSON
1. Scope#
YACE 只能采集 RDS / Aurora PostgreSQL 的 CloudWatch 指标,不能替代 postgres_exporter。
当前这套 dashboard 按 YACE 输出里的 dimension_DBClusterIdentifier 过滤,更适合 Aurora PostgreSQL / cluster 维度的 metrics。
use YACE for:
RDS / Aurora CPU / memory / connection / IO / cloud storage / replica lag
use postgres_exporter for:
pg_stat_activity
pg_stat_database
pg_stat_statements
locks / vacuum / table stats2. YACE Config#
apiVersion: v1alpha1
sts-region: ap-northeast-1
discovery:
jobs:
- type: AWS/RDS
regions: [ap-northeast-1]
customTags:
- key: environment
value: uat
period: 300
length: 600
nilToZero: true
metrics:
- name: CPUUtilization
statistics: [Average]
- name: FreeableMemory
statistics: [Average]
- name: DatabaseConnections
statistics: [Average]
- name: ReadLatency
statistics: [Average, p95]
- name: WriteLatency
statistics: [Average, p95]
- name: ReadIOPS
statistics: [Average]
- name: WriteIOPS
statistics: [Average]
- name: VolumeBytesUsed
statistics: [Average]
period: 300
length: 900
- name: AuroraReplicaLagMaximum
statistics: [Maximum]
- name: Deadlocks
statistics: [Sum]Aurora note:
当前 dashboard 按 cluster 维度工作,所以这里使用:
VolumeBytesUsed
AuroraReplicaLagMaximum
不是:
FreeStorageSpace
ReplicaLag
如果 cluster 没有 reader,Aurora replica lag panel 仍然可能是 no data。
`VolumeBytesUsed` 建议单独拉长查询窗口:
```yaml
- name: VolumeBytesUsed
statistics: [Average]
period: 300
length: 900原因:
这个 metric 不是每个很短窗口都稳定返回 datapoint。
length 比 period 更长,可以降低 YACE 因为短时取不到点而补成 0 的概率。
Dashboard 选择:
```text
aws-aurora-postgresql-yace-overview-dashboard.json:
使用 $dimension_DBClusterIdentifier 过滤。
适合单一环境,或者 cluster 名本身已经足够区分环境。
aws-aurora-postgresql-yace-env-overview-dashboard.json:
使用 $environment + $dimension_DBClusterIdentifier 过滤。
适合同一个 Prometheus / VictoriaMetrics 里同时存在 uat、prod 等多个环境的 Aurora / RDS cluster metrics。3. Dashboard Rows#
| Row | Panels |
|---|---|
| Overview | CPU, free memory, connections, read/write latency |
| Drilldown | read/write IOPS, deadlocks, Aurora replica lag |
| Capacity | storage used, connections trend, IOPS trend |
| Debug | latency split and deadlock trend |
Trend note:
带 Trend 的 panel 不是原始单点值。
当前 Aurora PostgreSQL dashboard 里:
Connections Trend
最近 1 小时 rolling average
IOPS Trend
最近 1 小时 rolling average
Deadlock Trend
最近 1 小时 rolling sum4. Verify#
{__name__=~"aws_rds_.*"}