19. Extended Events

The predecessor to Extended Events was SQL Trace, and its GUI, called Profiler. This is now deprecated for use with the Database Engine, and it is recommended that you only use it for tracing Analysis Service activity.

Extended Events Concepts

An event is an occurrence of interest that you can trace

KW aka category

A target is a consumer of events

A session is essentially a trace

When a session starts, events are written to memory buffers and have predicates applied before they are sent to the target

NO_EVENT_LOSS option for EVENT_RETENTION_MODE causes performance issues!

Data viewer does not support the ring buffer or ETW target types

sys.fn_xe_file_target_read_file

Perfmon counters are in the Analytic channel but have no category

The SQL Server service account must be in the Performance Log Users group, or an error is thrown.

Events are points of interest that are captured in a trace, whereas actions provide extended information, in addition to the event columns. Predicates allow you to filter events in order to provide a more targeted trace, and targets define how the data is stored. A session is the trace object itself and can be configured to include multiple events, actions, predicates, and targets.