Prometheus 本地存储容量有限、查询变慢或需要长期保留。VictoriaMetrics 兼容 PromQL 和 Remote Write,存储效率高,适合替换单机 Prometheus 或作为长期存储。
helm repo add vm https://victoriametrics.github.io/helm-charts/
helm install vm vm/victoria-metrics-single \
--namespace monitoring \
--set server.retentionPeriod=12
kubectl -n monitoring get pods
remote_write:
- url: http://vm-victoria-metrics-single-server:8428/api/v1/write
helm install vmagent vm/victoria-metrics-agent \
--namespace monitoring \
--set remoteWrite.url=http://vm-victoria-metrics-single-server:8428/api/v1/write
vmctl prometheus --prometheus-url=http://prometheus:9090 \
--start=2026-09-01T00:00:00Z \
--end=2026-10-01T00:00:00Z
vmalert -rule=/etc/prometheus/rules/*.yml \
-datasource.url=http://vm:8428 \
-notifier.url=http://alertmanager:9093
http://vm-victoria-metrics-single-server:8428
vmctl — 历史数据导入vmalert — 告警规则vmagent — 指标采集promtool — 校验 Prometheus 规则kubectl — 查看组件