Alerting: Attach screenshot data to Slack notifications. (#49374)

This change extracts screenshot data from alert messages via a private annotation `__alertScreenshotToken__` and attaches a URL to a Slack message or uploads the data to an image upload endpoint if needed.

This change also implements a few foundational functions for use in other notifiers.
This commit is contained in:
Joe Blubaugh
2022-05-23 14:24:20 +08:00
committed by GitHub
parent 5645d7a5e3
commit 12c25759da
11 changed files with 263 additions and 42 deletions
+2
View File
@@ -96,6 +96,8 @@ func (s *ScreenshotImageService) NewImage(ctx context.Context, r *ngmodels.Alert
DashboardUID: *r.DashboardUID,
PanelID: *r.PanelID,
})
// TODO: Check for screenshot upload failures. These images should still be
// stored because we have a local disk path that could be useful.
if err != nil {
return nil, fmt.Errorf("failed to take screenshot: %w", err)
}