我在配置Prometheus规则时遇到了麻烦。
PrometheusRules.yml:
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
prometheus: example
role: alert-rules
name: prometheus-example-rules
spec:
groups:
- name: example-rules
rules:
- alert: ExampleAlert
expr: base_memory_usedHeap_bytes{quantile="0.5"} > 1
Prometheus.yml
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
name: main
spec:
serviceAccountName: prometheus
replicas: 1
serviceMonitorSelector:
matchLabels:
team: frontend
ruleSelector:
matchLabels:
role: alert-rules
prometheus: example
resources:
requests:
memory: 400Mi
Prometheus无法加载规则。我想知道PrometheusRules配置是否有问题?现在,我只想有一个简单的“ hello word”规则。
谢谢!