Skip to content

Fix NOC deadlock/blocking timestamps showing 'just now' for stale events (fixes #187)#196

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/noc-deadlock-timestamp-187
Feb 20, 2026
Merged

Fix NOC deadlock/blocking timestamps showing 'just now' for stale events (fixes #187)#196
erikdarlingdata merged 1 commit intodevfrom
fix/noc-deadlock-timestamp-187

Conversation

@erikdarlingdata
Copy link
Owner

Summary

  • Extended Events timestamps are UTC, but the NOC queries used SYSDATETIME() (local time)
  • On a UTC-8 server, DATEDIFF(MINUTE, utc_event_time, local_sysdatetime) returned -480 for recent events
  • FormatMinutesAgo treats anything < 1 as "just now" — so all deadlocks/blocking appeared as "just now"
  • Changed SYSDATETIME() to SYSUTCDATETIME() in both the deadlock and blocking "last event" queries

Test plan

  • Verified sql2022 is UTC-8 (DATEDIFF(MINUTE, SYSUTCDATETIME(), SYSDATETIME()) = -480)
  • NOC overview now shows correct "Xh ago" / "Xd ago" for last deadlock and blocking events

🤖 Generated with Claude Code

…187)

Extended Events timestamps are UTC but the NOC queries used SYSDATETIME()
(local time). On a UTC-8 server, DATEDIFF returned -480 for recent events,
which FormatMinutesAgo treated as "just now". Changed to SYSUTCDATETIME().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 55e9378 into dev Feb 20, 2026
3 checks passed
@erikdarlingdata erikdarlingdata deleted the fix/noc-deadlock-timestamp-187 branch February 20, 2026 13:20
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.

1 participant