BrentOzarULTD / SQL-Server-First-Responder-Kit

sp_Blitz, sp_BlitzCache, sp_BlitzFirst, sp_BlitzIndex, and other SQL Server scripts for health checks and performance tuning.
http://FirstResponderKit.org
Other
3.37k stars 997 forks source link

sp_Blitz incorrectly reporting the default XE diagnostics session as an extra one #1393

Closed elsimer closed 6 years ago

elsimer commented 6 years ago

Do you want to request a feature or report a bug? sp_Blitz Version 6.1 (20180101 Date) lines 4239-4260 check for extended event sessions that are not standard and are running.

What is the current behavior? SELECT name FROM sys.dm_xe_sessions; returns several rows that include

Line 4258 excludes names that are not in ( 'AlwaysOn_health', 'system_health', 'telemetry_xevents', 'sp_server_diagnostics', 'hkenginexesession' )

If I have 1 additional extended event session then I will trip CheckId 176.

What is the expected behavior? I would expect that sp_server_diagnostics session would be excluded from the check as well.

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures? I've tested this on SQL Server 2016 SP1 CU2 and CU7 as well as SQL Server 2008R2 SP3. It looks like this was broken by @BlitzErik commit 1c7c8ee4443dfdaac5bf4ca8cb6a3d52c38cd324 (which was supposed to fix issue #1116

In the process of adding the exclusion for AlwaysOn_health session, the name of the sp_server_diagnostics session event was altered (because it's also the only extended event session that has a space followed by the word session).

BlitzErik commented 6 years ago

Ah, good catch. For some reason I thought the space I had in there was erroneous.

image

Did you want to fix this?

Thanks!

elsimer commented 6 years ago

I haven't set myself up to contribute fixes yet but I'm going to try to get set up today.