Skip to content

Add diagnostics for Alert Dismissal#721

Merged
erikdarlingdata merged 11 commits intoerikdarlingdata:devfrom
HannahVernon:fix/alert-dismiss-logging-718
Mar 27, 2026
Merged

Add diagnostics for Alert Dismissal#721
erikdarlingdata merged 11 commits intoerikdarlingdata:devfrom
HannahVernon:fix/alert-dismiss-logging-718

Conversation

@HannahVernon
Copy link
Copy Markdown
Contributor

What does this PR do?

Per the question #718 , this branch adds user-configurable diagnostic logging for Alert Dismissal and Muting, to help investigate why dismissal is not working under certain conditions.

Which component(s) does this affect?

  • [✅] Full Dashboard
  • [✅] Lite Dashboard
  • Lite Tests
  • SQL collection scripts
  • CLI Installer
  • GUI Installer
  • Documentation

How was this tested?

Tested Lite and Dashboard against SQL Server 2019 on-premises.

From Lite:

2026-03-26 16:29:11.499 [INFO ] [AlertDismiss] Dismissing 1 selected alert(s)
2026-03-26 16:29:11.538 [INFO ] [AlertDismiss] Dismiss complete: 1 row(s) updated out of 1 selected

From Dashboard:

[2026-03-26 16:32:38.675] [INFO] [AlertDismiss] Dismissed 1 of 1 selected alert(s)
[2026-03-26 16:32:43.182] [INFO] [AlertDismiss] Dismissed 4 of 4 selected alert(s)

Checklist

  • [✅] I have read the contributing guide
  • [✅] My code builds with zero warnings (dotnet build -c Debug)
  • [✅] I have tested my changes against at least one SQL Server version
  • [✅] I have not introduced any hardcoded credentials or server names

HannahVernon and others added 11 commits March 10, 2026 17:08
- Parse detail_text to extract Database, Query Text, and Wait Type
  when using 'Mute This Alert' from alert history (both editions)
- Add PopulateFromDetailText() to AlertMuteContext for structured
  field extraction from the label: value format
- Add 'Default expiration for new mute rules' dropdown to Settings
  in both editions (1 hour, 24 hours, 7 days, Never; default 24h)
- MuteRuleDialog now selects the configured default expiration
  instead of always defaulting to 'Never'
- Persist setting as mute_rule_default_expiration in settings.json
  (Lite) and preferences.json (Dashboard)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The XML doc claimed Job Name extraction but the parser did not
implement it. Add the missing branch in both Dashboard and Lite
editions so the behavior matches the documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Collapse newlines in Truncate/TruncateText so detail_text fields
  stay single-line in the label: value format
- Handle multi-line query values in PopulateFromDetailText by
  accumulating continuation lines until the next indented field
- Recognize variant query labels (Blocked Query, Blocking Query,
  Victim SQL) in addition to Query

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Explain that the field is a case-insensitive substring match and
suggest entering a distinctive fragment like a table or procedure name.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ingdata#718)

Both editions gain a 'Log alert dismiss and mute actions' checkbox in
Settings under Alert Muting. When enabled (the default), dismiss and
mute operations write Info/Warn entries to the log file with row counts
and diagnostic context. This helps troubleshoot issue erikdarlingdata#718 where
dismiss stops working after many alerts accumulate.

Lite: guards AppLogger calls behind App.LogAlertDismissals, persisted
to settings.json as log_alert_dismissals.

Dashboard: guards Logger calls behind UserPreferences.LogAlertDismissals,
persisted to preferences.json via standard serialization.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@HannahVernon HannahVernon mentioned this pull request Mar 26, 2026
Copy link
Copy Markdown
Owner

@erikdarlingdata erikdarlingdata left a comment

Choose a reason for hiding this comment

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

Clean, well-scoped diagnostic PR. The changes look good:

  • DismissAlertsAsync returning int is a nice improvement — callers can now detect partial updates and warn about parquet-archived rows.
  • AND dismissed = FALSE in the WHERE clause is a good defensive addition.
  • Logging is properly gated behind LogAlertDismissals so there's no overhead when disabled.

Minor note: AlertsHistoryTab.xaml.cs line 75 adds an AppLogger.Debug call that isn't gated behind LogAlertDismissals (all the other new logging is). Debug level so likely fine, but inconsistent with the pattern.

Heads up — merge conflict incoming: PR #724 (per-server collector schedules) just merged into dev and changed the SettingsWindow.xaml.cs constructor signature and structure. This PR's patches to that file will conflict. The .xaml change (checkbox in the Notifications section) should be fine, but the .xaml.cs will need a rebase against current dev. Happy to help resolve if needed.

@erikdarlingdata erikdarlingdata merged commit 68d7395 into erikdarlingdata:dev Mar 27, 2026
3 checks passed
@HannahVernon HannahVernon deleted the fix/alert-dismiss-logging-718 branch March 27, 2026 14:09
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