最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

promql - Re-firing Grafana alert returns value -1 - Stack Overflow

programmeradmin4浏览0评论

My grafana "success rate alert" returns value of -1 when re-fired probably because when the re-fire happens there is no data.

I've configured the alerting policy to be "Keep Last State" if no data , however this keeps only the state, not the value. (note* I want the alert not to auto-resolve unless success rate >90% is reached)

Is there a way to show the initial alert success rate on alert re-firing instead of -1 ?

PromQL query:

   (
        (
          sum by (uri, method) (
            increase(http_client_requests_milliseconds_count{
              system_name="system-1",
              deployment_environment="dev",
              service_name="service-1",
              outcome="SUCCESS"
            }[15m]) or vector (0)
          )
        )
        /
        (
          sum by (uri, method) (
            increase(http_client_requests_milliseconds_count{
              system_name="system-1",
              deployment_environment="dev",
              service_name="service-1"
            }[15m]) or vector (0)
          ) > 0 
        )
      ) * 100

Alert rule Math: ($A >= 0) * ($A <= 90)

发布评论

评论列表(0)

  1. 暂无评论