Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: longRunningTransactionsAgeInSeconds #978

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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 <roman@pertl.org>
@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?

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.

None yet

2 participants