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

Add alert status for extended and simple output #2324

Merged
merged 1 commit into from
Jul 24, 2020

Conversation

ffahri
Copy link
Contributor

@ffahri ffahri commented Jul 16, 2020

Closes #2204
Signed-off-by: Fahri Yardımcı

Added state field into both simple and extended output.

sometimes extended output can be a bit long and can be hard to read sometimes therefore finding the alert state in simple output can things much easier.

Extended output

$ ./amtool --alertmanager.url http://alertmanager:9093 alert query -o extended -s -a  'alertname="Watchdog"'
Labels                                                            Annotations  Starts At  Ends At  Generator URL  State
alertname="Watchdog" prometheus="test" severity="none"  message="This is an alert meant to ensure that the entire alerting pipeline is functional.
"                                                                 2020-07-10 11:00:00 UTC  2020-07-16 16:00:00 UTC  http://prom:9090/graph?g0.expr=vector%281%29&g0.tab=1  active

Simple output

$ ./amtool --alertmanager.url http://alertmanager:9093 alert query  -s -a  'alertname="Watchdog"'
Alertname  Starts At                Summary  State
Watchdog   2020-07-10 11:00:00 UTC           active

Not sure about the state field order in extended output ?

Copy link
Member

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think it makes sense to have the alert's state in the simple output and if we have it there, it should in the extended output too.

@simonpasquier simonpasquier merged commit 41cd012 into prometheus:master Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

amtool should display the state of an alert (active, unprocessed, inhibited, silenced)
2 participants