1

I have SQL Server running in a docker image. I have an extended event session running on it. I can connect to it fine and view live data with SSMS. I can use T-SQL to view the histogram target. If this was a windows box, I could use logman.exe to view and manage the event trace session. How do I do it in SQL Server for Linux?

I am absolutely sure that the ETW is getting created.

SELECT
    xes.name AS [Session Name],
    CAST(xest.target_data AS xml) [Histogram XML],
    xest.target_name
    FROM sys.dm_xe_session_targets xest  
    INNER JOIN sys.dm_xe_sessions xes ON xes.address = xest.event_session_address  
    WHERE xest.target_name = 'etw_classic_sync_target';

<ETWTarget truncated="0"> <DefaultETWSession> <Name>XE_DEFAULT_ETW_SESSION</Name> <Path>C:\Users\Client\Temp\XEEtw.etl</Path> <BufferSizeKb>128</BufferSizeKb> <FileSizeMb>20</FileSizeMb> </DefaultETWSession> <DefaultXESession> <Name>XE_DEFAULT_ETW_SESSION</Name> </DefaultXESession> </ETWTarget>

However, if I execute find / -iname XEEtw.etl inside bash on the docker container I get no results. I know that SQL Server on Linux is running its own internal copy of Windows NT. I just don't know if that ETW is exposed.

3
  • why don't you choose a file or ring buffer target and read from there? There is no ETW on Linux Commented Jul 16, 2018 at 18:38
  • @rudibruchez Well if I could avoid writing XPath to get tabular output it would be nice. I guess I could learn PowerBI or PowerQuery to get that though. Commented Jul 16, 2018 at 18:56
  • 1
    You can use SSMS to show the tabular result of a file target Commented Jul 17, 2018 at 15:20

1 Answer 1

1

How do I access ETW Traces on SQL Server for linux?

Unfortunately, ETW (Event Tracing for Windows) is not available on Linux. It is a Windows-only function. So for the time being you are stuck with the SQL and filesystem options for view the EE data.

The .NET Core team chose LTTng for trace support when .NET apps are running on Linux. You could explore that as an option for correlating OS events with those recorded by SQL Server.


After your update (super interesting that ETW events might be firing in Drawbridge), I see that the .etl file is getting created on a file path that probably doesn't exist on your Linux-based Docker container. You should try setting a known-good file path when you create the XE session:

ADD TARGET package0.etw_classic_sync_target   
    (SET default_etw_session_logfile_path = N'/temp/sqletw.etl' )  
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.