question

chrisrdba avatar image
0 Votes"
chrisrdba asked chrisrdba commented

Extended Events not collecting data.


Greetings. I have EE's running in an Azure SQL DB, collecting data to a ring buffer w success on a low usage environment. It collects data fine for a couple days then simply stops collecting. The only way I've found is to get it collecting data again is to stop/ start the whole thing.

A couple fun facts:

  1. It doesn't actually stop until I stop it -- it's still running but just not collecting data.

  2. I have the option checked to start on startup.

  3. According to various articles I've read entries to the ring buffer are FIFO, so if it gets full it should simply wipe out old entries to make room for new entries.

Any ideas?



azure-sql-database
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Not that I am sure that I can help, but which event(s) are you are collecting?

0 Votes 0 ·

CREATE EVENT SESSION [longRunningQueries] ON DATABASE
ADD EVENT sqlserver.rpc_completed(
ACTION(sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.database_name,sqlserver.session_id,sqlserver.sql_text,sqlserver.username)
WHERE ([duration]>=(25000000))),
ADD EVENT sqlserver.sp_statement_completed(SET collect_object_name=(1),collect_statement=(1)
ACTION(sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.session_id,sqlserver.sql_text,sqlserver.username)
WHERE ([duration]>=(25000000))),
ADD EVENT sqlserver.sql_batch_completed(
ACTION(sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.database_name,sqlserver.session_id,sqlserver.sql_text,sqlserver.username)
WHERE ([duration]>=(25000000)))
ADD TARGET package0.ring_buffer
WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=ON)
GO


0 Votes 0 ·

1 Answer

KalyanChanumolu-MSFT avatar image
0 Votes"
KalyanChanumolu-MSFT answered chrisrdba commented

@chrisrdba Thank you for reaching out.

You have to specify the EVENT_RETENTION_MODE while creating the event session so that SQL Server can understand which events can be dropped when the ring buffer(s) are full.

These are the allowed retentions modes.

ALLOW_SINGLE_EVENT_LOSS An event can be lost from the session. A single event is only dropped when all the event buffers are full. Losing a single event when event buffers are full allows for acceptable SQL Server performance characteristics, while minimizing the loss of data in the processed event stream.

ALLOW_MULTIPLE_EVENT_LOSS Full event buffers containing multiple events can be lost from the session. The number of events lost is dependent upon the memory size allocated to the session, the partitioning of the memory, and the size of the events in the buffer. This option minimizes performance impact on the server when event buffers are quickly filled, but large numbers of events can be lost from the session.

NO_EVENT_LOSS No event loss is allowed. This option ensures that all events raised will be retained. Using this option forces all tasks that fire events to wait until space is available in an event buffer. This may cause detectable performance issues while the event session is active. User connections may stall while waiting for events to be flushed from the buffer.

More details are here

Please let us know if you have any further questions.


If an answer is helpful, please "Accept answer" or "Up-Vote" which might help other community members reading this thread.


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This is my current setting:

EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,

0 Votes 0 ·

While I cannot troubleshoot this remotely, how long do you need these events to persist?
Can you afford changing the retention to ALLOW_MULTIPLE_EVENT_LOSS and check if that helps?

0 Votes 0 ·
chrisrdba avatar image chrisrdba KalyanChanumolu-MSFT ·

I'd like them to persist as long as possible. I'm consistently getting < 100 records before it stops, so not sure changing that setting is going to leave it in a desirable state, even if it works.

0 Votes 0 ·