Skip to content

Detailed XEvents Tracing

JosephPilov-MSFT edited this page Apr 25, 2026 · 4 revisions

Detailed XEvents Tracing

Extended Events (XEvents) is the recommended mechanism for collecting SQL Server diagnostic data and is fully supported by SQL Nexus for import and analysis.

Impact of Detailed XEvents Tracing

XEvents can be used to troubleshoot a wide variety of SQL Server issues. However, if your server is very active with many concurrent users, you should carefully evaluate the overhead of the events you enable. Many events fire at the statement level — meaning one event per statement executed. On high-throughput systems with cursors, scalar UDFs, or very frequent small queries, this can generate significant overhead.

Examples of higher-overhead events to use with caution:

  • query_pre_execution_showplan
  • query_post_execution_showplan
  • query_post_compilation_showplan
  • lock_acquired
  • sql_statement_starting
  • sql_statement_completed
  • sp_statement_starting
  • sp_statement_completed

Lower-overhead alternatives (fire at batch/RPC level rather than statement level):

  • sql_batch_completed
  • rpc_completed
  • sql_batch_starting

XEvents Files SQL Nexus Can Import

SQL Nexus automatically detects and imports the following XEL file types:

XEL Source File Pattern Importer Notes
SQL LogScout XEL *LogScout*.xel ReadTrace (RML) Covers xevent_LogScout_target*.xel and SQLLogScout_AlwaysOn_Data_Movement*.xel
SQLDiag XEL *_SQLDIAG*.xel CustomXELImporter Auto-generated by SQL Server (e.g. sp_server_diagnostics on clustered servers)
Always On Health *AlwaysOn_health*.xel CustomXELImporter Built-in SQL Server Always On health session
System Health *system_health*.xel CustomXELImporter Built-in SQL Server system health session
PSSDIAG XEL *pssdiag*.xel ReadTrace (RML) Collected via PSSDIAG/DiagManager

Note on SQLDiag, Always On Health, and System Health XEL imports: These three XEL file types are disabled by default to avoid inflating the size of the SQL Nexus database, as they can be very large on active systems. To enable them, open the Import window, click Options, then navigate to Importers and enable the desired XEL import options before running

How XEvent Sessions Are Captured

SQL LogScout (Recommended)

SQL LogScout captures XEvent sessions as part of several of its collection scenarios (e.g. GeneralPerf, DetailedPerf, XEEvents). The resulting .xel files are placed in the output folder and can be directly imported into SQL Nexus.

PSSDIAG / DiagManager (Legacy)

PSSDIAG captures active XEvent sessions and events. A summary of the active XEvent sessions at collection time is recorded in a file named <servername>_Profiler Traces_Startup.OUT, which SQL Nexus imports to provide context on what was being traced.

Tips for Minimizing Overhead

  • Prefer batch/RPC-level events over statement-level events on busy systems.
  • Use predicate filters in your XEvent session to limit capture to specific databases, logins, or applications.
  • Set a maximum file size and file rollover to prevent runaway disk usage.
  • Consider collecting XEvents only during a known problem window rather than continuously.

Clone this wiki locally