Skip to content

Conversation

@roock
Copy link

@roock roock commented Nov 30, 2023

  • clock_timestamp will just return the current timestamp
  • what we actually want to know is the lowest timestamp of the xact_start column

Please also see:
#836 (comment)
and the original can be found here:
https://gitlab.com/gitlab-cookbooks/gitlab-exporters/-/blob/master/templates/postgres_exporter/queries.yaml.erb#L954

(the originally proposed version MAX(EXTRACT(EPOCH FROM (clock_timestamp() - xact_start))) AS age_in_seconds is also correct, but return the seconds, not the timestamp.

Using the current version the graphs look like this (flat line as this will always match the current time):
Screenshot 2023-11-30 at 15 51 56

- clock_timestamp will just return the current timestamp
- what we actually want to know is the lowest timestamp of the xact_start column

Signed-off-by: Roman Pertl <[email protected]>
@sberlin
Copy link

sberlin commented Apr 24, 2024

The collector for long running transactions is not telling anything about long running transactions. Can we get this reviewed and merged, please?

@roock
Copy link
Author

roock commented Dec 20, 2024

Closing in favor of #1092

@roock roock closed this Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants