i noticed the sqlhealth extende event is on by default , so can i reduce

Rajesh Kumar Yadav 20 Reputation points
2025-12-12T12:06:09.9233333+00:00

hi,

i noticed the sqlhealth extended event is on by default , and it logs many thing,

Q1) can i reduce few thing so that file size and recording that is wirting from buffer to file can be reduced, thus i will save some resources.

q2) and can i add few events which are required by be like queris which takes more than 15 sec should be logged using

sql_statement_completed,sp_statement_completed

SQL Server Database Engine
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2025-12-12T12:06:23.43+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The system_health session is a default Extended Events session that is included with SQL Server and Azure SQL Managed Instance. It is not recommended to stop, alter, or delete this session, as any changes might be overwritten by future product updates. Therefore, you cannot reduce the events that it logs directly.

    However, you can create your own Extended Events session to log specific events, such as those related to queries that take longer than 15 seconds. You can configure your session to include events like sql_statement_completed and sp_statement_completed, allowing you to capture the information you need without affecting the default system_health session.

    To manage the size of the logs, you can set the file size and retention policy for your custom session according to your requirements, which can help save resources.


    References:


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.