Skip to content

Conversation

@sv-splunk
Copy link
Contributor

@sv-splunk sv-splunk commented Dec 15, 2025

Description

The query metrics collection window currently misses the collection of long running queries (those ran for > 2 minutes).

In the collector query we check if the last_execution_time of query is within the collection window. But technically the last_execution_time of a query is the execution start time and this is only recorded once the execution is finished.

Because of this behaviour, long ran queries will never be collected with the existing method.

Instead of looking at just the last_execution_time, we should consider last_execution_time + last_elapsed_time of the query to be in the required collection window.

Link to tracking issue

Fixes #44984

Testing

Test files updated

@sv-splunk sv-splunk marked this pull request as ready for review December 17, 2025 16:17
@sv-splunk sv-splunk requested review from a team and crobert-1 as code owners December 17, 2025 16:17
@github-actions github-actions bot added receiver/sqlserver Run Windows Enable running windows test on a PR labels Dec 17, 2025
@github-actions github-actions bot requested a review from sincejune December 17, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

receiver/sqlserver Run Windows Enable running windows test on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sqlserver/receiver] The query metrics collection misses collection of long running queries

3 participants