-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Labels
enhancementNew feature or requestNew feature or requestneeds triageNew item requiring triageNew item requiring triagereceiver/postgresql
Description
Component(s)
receiver/postgresql
Is your feature request related to a problem? Please describe.
The logs collection in PostgreSQL receiver currently does not include execution time of the currently running queries in payload. This needs to be calculated in the collector query itself based on the query_start time.
Describe the solution you'd like
The query execution time for currently running queries can be calculated by the collector query (query_samples) itself with the addition of below logic:
CASE
WHEN state = 'active' THEN
EXTRACT(EPOCH FROM (clock_timestamp() - query_start)) * 1e3
WHEN state IN ('idle','idle in transaction','idle in transaction (aborted)')
AND state_change IS NOT NULL THEN
EXTRACT(EPOCH FROM (state_change - query_start)) * 1e3
ELSE
NULL
END AS duration_ms
Describe alternatives you've considered
No response
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.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestneeds triageNew item requiring triageNew item requiring triagereceiver/postgresql