如何在prometheus运算符中获得有关配置重新加载器错误的通知或警报?

问题描述 投票:2回答:1

我使用prometheus运算符在kubernetes上部署监控堆栈。我想知道是否有办法知道配置重新加载器部署的配置是否失败。对于使用配置重新加载器容器重新加载其配置的prometheus和警报管理器资源,这是有价值的。配置失败时我们在容器中有一个登录但是我们可以根据失败的配置重新加载通知或警报吗?

kubernetes prometheus prometheus-alertmanager prometheus-operator
1个回答
3
投票

普罗米修斯暴露了你可以刮去的/公制端点。特别是,有一个指标指示上次重新加载是否成功:

# HELP prometheus_config_last_reload_successful Whether the last configuration reload attempt was successful.
# TYPE prometheus_config_last_reload_successful gauge
prometheus_config_last_reload_successful 0

您可以使用它来警告重新加载失败。

groups:
- name: PrometheusAlerts
  rules:
  - alert: FailedReload
    expr: prometheus_config_last_reload_successful == 0
    for: 5m
    labels:
      severity: warning
    annotations:
      description: Reloading Prometheus' configuration has failed for {{$labels.namespace}}/{{ $labels.pod}}.
      summary: Prometheus configuration reload has failed
© www.soinside.com 2019 - 2024. All rights reserved.