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

Alert always update Active Since date to current time and cant fire #4652

Closed
Teriand opened this Issue Sep 25, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@Teriand
Copy link

Teriand commented Sep 25, 2018

Bug Report

What did you do?
After upgrade 2.3.2 ->2.4.2
Alert always update Active Since date to current time and cant fire:

image
ex on screen
alert: IgnoreAlert
expr: vector(1)
for: 10s

cant fire. Before update i use him for tesing and it fire work.
"Active Since" always set after refresh page to current time.
or
curl http://localhost:9090/api/v1/alerts

,{"labels":{"alertname":"IgnoreAlert","grafana":"http://prometheus-01:3000?from=1537865257060\u0026to=1537868857060","severity":"warn","type":"test","zone":"test"},"annotations":{"description":"Daily alert test description","summary":"Daily alert test summary http://prometheus-01:3000/d/000000011/windows-node-test-stands?refresh=10s\u0026orgId=1\u0026var-interval=60s\u0026var-server=auto-fna-62\u0026from=now-3h\u0026to=now"},"state":"pending","activeAt":"2018-09-25T12:17:37.060655984+03:00","value":1}]}}

What did you expect to see?
Change Pending to Fire state

What did you see instead? Under which circumstances?
Persist Pending state

Environment

  • System information:

Linux 4.1.12-61.1.18.el7uek.x86_64 x86_64

  • Prometheus version:
    prometheus, version 2.4.2 (branch: HEAD, revision: c305ffa)
    build user: root@dcde2b74c858
    build date: 20180921-07:22:29
    go version: go1.10.3

  • Prometheus configuration file:

global:
  scrape_interval:     15s
  evaluation_interval: 15s
  scrape_timeout: 15s
alerting:
  alertmanagers:
  - static_configs:
    - targets: ['prometheus-01:9093']
rule_files:
   - "test-alert.yml"
scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['prometheus-01:9090']
    metric_relabel_configs:
      - source_labels: [ __name__ ]
        regex: 'go_(.*)'
        action: drop
@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Sep 25, 2018

This is because your grafana label value is changing everytime Prometheus evaluates the alert. It was a bug (#4169) in the alerting code and it has been fixed in 2.4.x. You should store this value as an annotation instead.

@Teriand

This comment has been minimized.

Copy link
Author

Teriand commented Sep 25, 2018

but #4169 closed and #4500 merget, next #4571 track it ?

ps
move grafana from labels to annotations work fine. thx

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Sep 25, 2018

#4571 can be closed too if it is really a duplicate of #4169.

@Teriand

This comment has been minimized.

Copy link
Author

Teriand commented Sep 25, 2018

and mb open my issue to track fix alerting code in 2.4.x?

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Sep 26, 2018

I'm not sure to understand your last question but there's no bug to be fixed. The alert's identity is defined by its labels. If the labels aren't constant over time then they are different alerts.

@Teriand

This comment has been minimized.

Copy link
Author

Teriand commented Sep 26, 2018

ok, i mistake u message: " It was a bug (#4169) in the alerting code and it has been fixed in 2.4.x."
I change all my alert-rule files for annotatons.
thx.

@lock lock bot locked and limited conversation to collaborators Mar 25, 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.