-
Notifications
You must be signed in to change notification settings - Fork 164
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
Ele 3682 alerts grouping #1716
Ele 3682 alerts grouping #1716
Conversation
👋 @MikaKerman |
dbef87b
to
38c709f
Compare
883026f
to
6ee5466
Compare
7abcef2
to
ad400ee
Compare
ad400ee
to
35fb51b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Left a few small comments
elementary/config/config.py
Outdated
self.group_alerts_threshold = self._first_not_none( | ||
group_alerts_threshold, | ||
slack_config.get("group_alerts_threshold"), | ||
100, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider extracting the 100 to a constant (and use it in the cli as well :) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
else: | ||
flattened_alerts.append(alert) | ||
|
||
if len(flattened_alerts) > threshold: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(flattened_alerts) > threshold: | |
if len(flattened_alerts) >= threshold: |
when there are 100 alerts, they should send in a single message, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Union[ | ||
TestAlertModel, | ||
ModelAlertModel, | ||
SourceFreshnessAlertModel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SourceFreshnessAlertModel, | |
SourceFreshnessAlertModel, | |
GroupedByTableAlerts, |
no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the alert is an AlertsGroup, the inner alerts will be generated. This changes the behavior of GroupedByTableAlerts, but I checked that the method's caller can handle it as well.
if isinstance(alert, AlertsGroup): |
for alert in alerts: | ||
text = f":{bullet_icon}: {alert.summary}" | ||
if alert.report_url: | ||
text = " - ".join([text, f"<{alert.report_url}|View Details>"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the url in your alerts, I think the report_url tasks to the dashboard, is this what we want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
9b493f5
to
621e3fe
Compare
2584cd7
to
5f1d7a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
5f1d7a7
to
a074335
Compare
null