Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The value of $value will not change when recovery occurs. #3986

Closed
zhou-mfk opened this Issue Mar 20, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@zhou-mfk
Copy link

zhou-mfk commented Mar 20, 2018

Hi
I have a confusion about the variable {{$value}} in the promethues alert rule.
When a monitoring item is restored, I always get the correct value. The value of the {{$value}} variable represents the alarm at firing time.

Environment

  • System information:

    Linux 3.10.0-514.el7.x86_64 x86_64

  • Prometheus version:

    prometheus, version 2.2.1 (branch: HEAD, revision:
    bc6058c)
    build user: root@149e5b3f0829
    build date: 20180314-14:15:45
    go version: go1.10

  • Alertmanager version:
    alertmanager, version 0.11.0 (branch: HEAD, revision: 30dd0426c08b6479d9a26259ea5efd63bc1ee273)
    build user: root@3e103e3fc918
    build date: 20171116-17:43:56
    go version: go1.9.2

  • Prometheus configuration file:

Prometheus rules config
- alert: App_Close_Wait_GT_500
    expr: appstatus_appclosewait > 500
    for: 1m
    labels:
      alert_type: app
      monitor: appstatus_appclosewait
      serverity: critical
      current_value: '{{ $value }}'
    annotations:
      description: '{{$labels.instance }} of group {{ $labels.group }}'
      recovery: 'Recovery! Host {{ $labels.instance }} current value: {{ $value }} Project Name is {{ $labels.name }} CloseWait less than 500'
      summary: 'Host {{ $labels.host }} Project Name is {{ $labels.name }} CloseWait current value is: {{ $value }} more than 500'

The warning message I received is as follows.
image

At this point, {{$value}} is normal.

However, when recovery, the value of {{$value}} is not updated,
The recovery email is as follows
image

Can you tell me how to get the correct value in the alarm?

Thanks!

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Mar 20, 2018

Resolved alerts don't have a value, because that doesn't make sense.

It makes more sense to ask questions like this on the prometheus-users mailing list rather than in a GitHub issue. On the mailing list, more people are available to potentially respond to your question, and the whole community can benefit from the answers provided.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.