72 lines
1.4 KiB
YAML
72 lines
1.4 KiB
YAML
# 数据库监控 ServiceMonitors - 统一管理在 observability 命名空间
|
|
---
|
|
# PostgreSQL Metrics
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: postgres-metrics
|
|
namespace: observability
|
|
labels:
|
|
app: postgres
|
|
release: monitoring
|
|
spec:
|
|
namespaceSelector:
|
|
matchNames:
|
|
- data
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: metrics
|
|
app.kubernetes.io/name: postgresql
|
|
endpoints:
|
|
- port: http-metrics
|
|
interval: 30s
|
|
scrapeTimeout: 10s
|
|
path: /metrics
|
|
|
|
---
|
|
# Redis Metrics
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: redis-metrics
|
|
namespace: observability
|
|
labels:
|
|
app: redis
|
|
release: monitoring
|
|
spec:
|
|
namespaceSelector:
|
|
matchNames:
|
|
- data
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: metrics
|
|
app.kubernetes.io/name: redis
|
|
endpoints:
|
|
- port: http-metrics
|
|
interval: 30s
|
|
scrapeTimeout: 10s
|
|
path: /metrics
|
|
|
|
---
|
|
# MySQL Exporter Metrics
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: mysql-exporter
|
|
namespace: observability
|
|
labels:
|
|
app: mysql
|
|
release: monitoring
|
|
spec:
|
|
namespaceSelector:
|
|
matchNames:
|
|
- monitoring
|
|
selector:
|
|
matchLabels:
|
|
app: mysql-exporter
|
|
endpoints:
|
|
- port: metrics
|
|
interval: 30s
|
|
scrapeTimeout: 10s
|
|
path: /metrics
|