Yufeishao-msft, thank you for the reply!
"If you encount error, it is best to check your error log for more information, you can check if your configuration options have some issue" - I haven't found any XE-related errors in the logs and providing at least sometimes the pair-matching does return data I guess there're no configuration errors.
"For histogram, the value is object_id that you monitor the session" - I thought about it but
there was no any value that would resemble the values in the histogram's output:
- I mean there was no any value that was displayed as a 20-digit number in either Live Data output or in the file-target output.
According to the article you mentioned it's become obvious that the histogram's value field is derived from the Source parameter of the sqlserver.lock_acquired event only:
CREATE EVENT SESSION [LockAcquired] ON SERVER
ADD EVENT sqlserver.lock_acquired(
ACTION(package0.last_error,sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.database_name,sqlserver.is_system,sqlserver.query_hash,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username)
WHERE ([package0].greater_than_uint64 AND [package0].equal_boolean)),
ADD EVENT sqlserver.lock_released(
ACTION(sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.database_name,sqlserver.is_system,sqlserver.nt_username))
ADD TARGET package0.event_file(SET filename=N'C:\TEST\LockAquired.xel'),
ADD TARGET package0.histogram(SET filtering_event_name=N'sqlserver.lock_acquired',source=N'sqlserver.query_hash'),
ADD TARGET package0.pair_matching(SET begin_event=N'sqlserver.lock_acquired',begin_matching_actions=N'sqlserver.session_nt_username',begin_matching_columns=N'associated_object_id,database_name,duration,mode,resource_0,resource_1,resource_2,resource_description,transaction_id',end_event=N'sqlserver.lock_released',end_matching_actions=N'sqlserver.nt_username',end_matching_columns=N'associated_object_id,database_name,duration,mode,resource_0,resource_1,resource_2,resource_description,transaction_id',respond_to_memory_pressure=(1))
WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=ON,STARTUP_STATE=OFF)
GO
- so thank you for the article!
Regards,
Michael