-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Component(s)
receiver/sqlserver
What happened?
Description
The query metrics collection window always 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, the specific long ran query will never be collected in the existing method.
Proposed fix
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.
Expected Result
Metrics of long running queries are not collected.
Actual Result
Metrics of all queries those finished execution in the specific collection window should be fetched.
Collector version
v0.142.0
Environment information
All
OpenTelemetry Collector configuration
Log output
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.