You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking it would be nice to capture errors and warnings using an extended event like you do with the slow queries. Typically if someone tells me their app is timing out or something I will setup a session on the "Error Reported" event and filter out the every day warnings (5701, 5703, 8153, etc.). This would allow us gather things like malformed queries being executed, timeouts on connection, etc. and use that to work with the development teams. I think there would have to be something in the configuration side that we would use to filter out the error numbers we don't care about so that it's not taking up more storage than necessary.
CREATE EVENT SESSION [DBADash_Errors] ON SERVER
ADD EVENT sqlserver.error_reported( ACTION(package0.last_error,sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.database_name,sqlserver.is_system,sqlserver.query_hash,sqlserver.query_plan_hash,sqlserver.session_id,sqlserver.sql_text,sqlserver.username)
WHERE ([error_number]<>(5701) AND [error_number]<>(5703) AND [error_number]<>(8153)))
ADD TARGET package0.ring_buffer
WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_MULTIPLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=2 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=OFF)
GO
The text was updated successfully, but these errors were encountered:
I've thought about doing more stuff with extended events. It might also be useful to capture deadlocks #67 for example. Like deadlocks, error_reported is also captured via the system_health session - so pulling it from there could be an option. Or it might still make sense to have a custom session for it.
It's something I'll think about and might implement at some point.
I was thinking it would be nice to capture errors and warnings using an extended event like you do with the slow queries. Typically if someone tells me their app is timing out or something I will setup a session on the "Error Reported" event and filter out the every day warnings (5701, 5703, 8153, etc.). This would allow us gather things like malformed queries being executed, timeouts on connection, etc. and use that to work with the development teams. I think there would have to be something in the configuration side that we would use to filter out the error numbers we don't care about so that it's not taking up more storage than necessary.
CREATE EVENT SESSION [DBADash_Errors] ON SERVER
ADD EVENT sqlserver.error_reported( ACTION(package0.last_error,sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.database_name,sqlserver.is_system,sqlserver.query_hash,sqlserver.query_plan_hash,sqlserver.session_id,sqlserver.sql_text,sqlserver.username)
WHERE ([error_number]<>(5701) AND [error_number]<>(5703) AND [error_number]<>(8153)))
ADD TARGET package0.ring_buffer
WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_MULTIPLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=2 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=OFF)
GO
The text was updated successfully, but these errors were encountered: