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

Alerting: Add debug level logs before sending alerts to Alertmanager #106

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

grobinson-grafana
Copy link
Contributor

@grobinson-grafana grobinson-grafana commented Jun 20, 2023

This commit adds debug level logging for each alert before it is sent to the Alertmanager. The information logged is the fingerprint of the alert, the StartsAt timestamp and the EndsAt timestamp. The same fingerprint is also logged in the dispatcher of the Alertmanger for each alert received.

Here is an example of how it looks:

DEBUG[06-20|12:34:30] Putting alert                            logger=ngalert.notifier.alertmanager LOG15_ERROR= component=alertmanager orgID=1 alert=Test[7145c5e][active] starts_at=2023-06-20T11:43:00+01:00 ends_at=2023-06-20T12:36:00+01:00
DEBUG[06-20|12:34:30] Received alert                           logger=ngalert.notifier.alertmanager LOG15_ERROR= component=alertmanager orgID=1 component=dispatcher alert=Test[7145c5e][active]

Fixes https://github.com/grafana/support-escalations/issues/6191

@grobinson-grafana grobinson-grafana requested review from JacobsonMT and a team June 20, 2023 11:40
@grobinson-grafana grobinson-grafana self-assigned this Jun 20, 2023
@grobinson-grafana grobinson-grafana changed the title Grobinson/add debug logs for put alerts Alerting: Add debug level logs before sending alerts to Alertmanager Jun 20, 2023
This commit adds debug level logging for each alert before it is sent
to the Alertmanager. The information logged is the fingerprint of the
alert, the StartsAt timestamp and the EndsAt timestamp. The same
fingerprint is also logged in the dispatcher of the Alertmanger for
each alert received.
@grobinson-grafana grobinson-grafana force-pushed the grobinson/add-debug-logs-for-put-alerts branch from 7604c41 to 766dd8b Compare June 20, 2023 11:41
Copy link
Member

@JacobsonMT JacobsonMT left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@grobinson-grafana grobinson-grafana merged commit e1c1591 into main Jun 20, 2023
4 checks passed
@grobinson-grafana grobinson-grafana deleted the grobinson/add-debug-logs-for-put-alerts branch June 20, 2023 22:04
grobinson-grafana added a commit that referenced this pull request Jun 20, 2023
…106)

This commit adds debug level logging for each alert before it is sent
to the Alertmanager. The information logged is the fingerprint of the
alert, the StartsAt timestamp and the EndsAt timestamp. The same
fingerprint is also logged in the dispatcher of the Alertmanger for
each alert received.
grobinson-grafana added a commit that referenced this pull request Jun 26, 2023
…106)

This commit adds debug level logging for each alert before it is sent
to the Alertmanager. The information logged is the fingerprint of the
alert, the StartsAt timestamp and the EndsAt timestamp. The same
fingerprint is also logged in the dispatcher of the Alertmanger for
each alert received.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants