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

notifier: add notifier that logs alerts to stdout or file #2093

Closed

Conversation

jackhammer2k
Copy link

Adds a notifier that logs alerts to a file or standard out. Very useful if uploaded to a log service like Elastic stack or similar to get a history about the alerts. Although we have time series about firing alerts, we loose information encoded in text (e.g. summary). Especially alerts not coming from Prometheus may contain relevant information as annotation, which is lost otherwise.

Features like log rotation should be done externally (e.g. logrotate).

Signed-off-by: Christian Lorenz <jackhammer2k@gmail.com>
Signed-off-by: Christian Lorenz <jackhammer2k@gmail.com>
@brian-brazil
Copy link
Contributor

You can use the existing webhook for this.

@simonpasquier
Copy link
Member

Thanks for suggesting this change. Unfortunately, we are currently not accepting new integrations. As Brian noted, this can be achieved using the existing webhook integration (BTW there's already alertmanager2es if you want to send notifications to Elasticsearch).

We can only provide the stability and performance we want to provide if we can properly maintain the codebase. This includes, amongst others, test integrations in an automated and scalable fashion. For this reason, we are suggesting people integrate with the help of our generic interfaces. We have an integrations page on which integrations using our generic interfaces are listed.

Even if existing integrations can not be tested in an automated fashion, we will not remove them for reasons of compatibility. This also means that any additions we take on, or any changes to existing integrations we make or accept, will mean maintaining and testing these until at least the next major version, realistically even beyond that.

Feel free to question this answer on our developer mailing list, but be aware it's unlikely that you will get a different answer.

@jackhammer2k
Copy link
Author

jackhammer2k commented Nov 29, 2019

Thanks for the detailed explanation. I fully agree that you have to keep the amount of maintained code manageble and do provide generic interfaces to externalize custom integrations. However I have to say that this one might be an exception you should think about to still integrate.

  • Its just as generic as the webhook notifier. The webhook notifier uses common HTTP REST communication to allow external integrations. In the same manner the log notifier uses common logging, which Alertmanager already provides anyway, to allow external integrations if necessary at all. Thus custom logging product integrations and log(-file) handling are externalized as well.
  • It adds just a few lines of code to maintain.
  • Its an easy win to be able to say that the Alertmanager provides a history of alerts.

@jackhammer2k
Copy link
Author

Meanwhile we implemented an external service receiving and logging webhook messages:
https://github.com/tomtom-international/alertmanager-webhook-logger

Maybe that one can be mentioned as "integration" in docs.

@simonpasquier
Copy link
Member

Maybe that one can be mentioned as "integration" in docs.

Sure feel free to open a PR (see prometheus/docs#1525 for an example).

@stale stale bot added the stale label Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants