prometheus-community / postgres_exporter

A PostgreSQL metric exporter for Prometheus
Apache License 2.0
2.82k stars 743 forks source link

fix: longRunningTransactionsAgeInSeconds #978

Open roock opened 12 months ago

roock commented 12 months ago

Please also see: https://github.com/prometheus-community/postgres_exporter/pull/836#discussion_r1295748514 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

sberlin commented 7 months ago

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