Skip to content

feat(alert): attach dashboard screenshots to FlashDuty alerts - #3450

Merged
710leo merged 3 commits into
ccfos:devfrom
liangyanbin126:dev
Oct 28, 2026
Merged

710leo merged 3 commits into
ccfos:devfrom
liangyanbin126:dev

Conversation

@liangyanbin126

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Bug fix
  • New feature
  • Refactor / docs / chore / tests (no behavior change)
    What this PR does / why we need it:
    Support dashboard screenshots in FlashDuty alert notifications so responders can view metric trends directly in alerts.
  • Upload screenshots before sending alerts and attach the returned image key.
  • Reuse uploaded images across FlashDuty channels within the same notification batch.
  • Continue sending alerts if screenshot uploads fail.
  • Preserve original event data for other notification channels and remove base64 screenshots from outgoing FlashDuty events.
  • Add automated tests for upload failures, multi-channel reuse, event preservation, image size limits, and rule configuration precision.
    Which issue(s) this PR fixes:
    Fixes Support dashboard screenshots in FlashDuty alert notifications #3446
    Evidence (REQUIRED for bug fixes and features):
    Reproduction steps:
  1. Configure a FlashDuty notification channel.
  2. Send an alert event containing a dashboard screenshot in ShotImageBase64.
  3. Send the same batch to multiple FlashDuty channels.
  4. Repeat with a failed image upload to verify that alerts still get sent.
    Before:
    FlashDuty notifications did not upload screenshots or attach the corresponding image references.
    After (or the new feature page):
    Screenshots are uploaded before notification delivery. Outgoing alerts include annotations.img_key and rule_config.snapshot_pic_url, and multiple channels reuse the uploaded image. Upload failures do not block alert delivery.
    Local automated verification passed:
    go test ./alert/sender/provider -count=1
    go test -race ./alert/sender/provider -run FlashDuty -count=1
    git diff --check
    Real-instance verification and screenshots are still pending. Full-repository build and tests have not been run.
    Checklist:
  • I ran this change on a real Nightingale instance myself and attached screenshots above.
  • go build ./... and go test ./... pass locally.
  • If integrations/** changed: go run ./cmd/integrations-alert-action check and go run ./cmd/integrations-i18n check -scope all pass. — Not applicable.
  • If DB schema changed: gorm struct AND docker/initsql/a-n9e.sql, docker/sqlite.sql, docker/migratesql/migrate.sql are updated. — Not applicable.
  • AI tools were used to write this PR: yes — OpenAI Codex assisted with tests and the PR description.
    Special notes for your reviewer:
    This change handles screenshots already present in alert events; it does not enable upstream screenshot generation. Each event attaches one screenshot, selected by sorted key order after skipping blank values. Decoded images larger than 5 MiB are rejected. Image reuse is scoped to a single Notify call.
image

@710leo
710leo merged commit 5d1d0fb into ccfos:dev Oct 28, 2026
1 check passed
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.

2 participants