(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):
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):