I ran the following commands to setup extended event captures for blocked processes:
CREATE EVENT SESSION [blocked_process] ON SERVER ADD EVENT sqlserver.blocked_process_report( ACTION(sqlserver.client_app_name, sqlserver.client_hostname, sqlserver.database_name)) , ADD EVENT sqlserver.xml_deadlock_report ( ACTION(sqlserver.client_app_name, sqlserver.client_hostname, sqlserver.database_name)) ADD TARGET package0.asynchronous_file_target (SET filename = N'c:\temp\XEventSessions\blocked_process.xel', metadatafile = N'c:\temp\XEventSessions\blocked_process.xem', max_file_size=(65536), max_rollover_files=5) WITH (MAX_DISPATCH_LATENCY = 5SECONDS) GO
I also ran the following to set the blocked process report threshold to 5 seconds:
EXEC sp_configure 'show advanced options', 1 ; GO RECONFIGURE ; GO /* Enabled the blocked process report */ EXEC sp_configure 'blocked process threshold', '5'; RECONFIGURE GO /* Start the Extended Events session */ ALTER EVENT SESSION [blocked_process] ON SERVER STATE = START;
Using SQL studio manager's UI, I started the blocked_process extended event capture.
In order to test the setup, I explicitly started a transaction in one query window, edited a row, and attempted to edit the same row in another window.
The second window wouldn't complete until I ran "commit transaction" in the first window.
Despite the fact that I waited well over the 5 second blocking threshold, the blocked_process extended event capture didn't capture anything. Nor did it capture any blocking that occurred within our application, which it should have because I know there are blocking issues.
We are running sql server 2022 enterprise edition.
Is there some other configuration option I'm missing that may explain why I'm not capturing anything with my extended event session?