fbd34421f2
This updates the Prometheus chart to support federation. This moves to defining the Prometheus configuration file via a template in the values.yaml file instead of through raw yaml. This allows for overriding the chart's default configuration wholesale, as this would be required for a hierarchical federated setup. This also strips out all of the default rules defined in the chart for the same reason. There are example rules defined for the various aspects of OSH's infrastructure in the prometheus/values_overrides directory that are executed as part of the normal CI jobs. This also adds a nonvoting federated-monitoring job that vets out the ability to federate prometheus in a hierarchical fashion with extremely basic overrides Change-Id: I0f121ad5e4f80be4c790dc869955c6b299ca9f26 Signed-off-by: Steve Wilkerson <sw5822@att.com>
40 lines
1.7 KiB
YAML
40 lines
1.7 KiB
YAML
conf:
|
|
prometheus:
|
|
rules:
|
|
postgresql:
|
|
groups:
|
|
- name: postgresql.rules
|
|
rules:
|
|
- alert: prom_exporter_postgresql_unavailable
|
|
expr: absent(pg_static)
|
|
for: 10m
|
|
labels:
|
|
severity: warning
|
|
annotations:
|
|
description: postgresql exporter is not collecting metrics or is not available for past 10 minutes
|
|
title: postgresql exporter is not collecting metrics or is not available
|
|
- alert: pg_replication_fallen_behind
|
|
expr: (pg_replication_lag > 120) and ON(instance) (pg_replication_is_replica == 1)
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
annotations:
|
|
description: Replication lag on server {{$labels.instance}} is currently {{$value | humanizeDuration }}
|
|
title: Postgres Replication lag is over 2 minutes
|
|
- alert: pg_connections_too_high
|
|
expr: sum(pg_stat_activity_count) BY (environment, fqdn) > ON(fqdn) pg_settings_max_connections * 0.95
|
|
for: 5m
|
|
labels:
|
|
severity: warn
|
|
channel: database
|
|
annotations:
|
|
title: Postgresql has {{$value}} connections on {{$labels.fqdn}} which is close to the maximum
|
|
- alert: pg_deadlocks_detected
|
|
expr: sum by(datname) (rate(pg_stat_database_deadlocks[1m])) > 0
|
|
for: 5m
|
|
labels:
|
|
severity: warn
|
|
annotations:
|
|
description: postgresql at {{$labels.instance}} is showing {{$value}} rate of deadlocks for database {{$labels.datname}}
|
|
title: Postgres server is experiencing deadlocks
|