Try to avoid the metrics endpoint timing out

This commit is contained in:
Christopher Baines 2025-06-28 16:03:43 +02:00
parent 40212ea053
commit 3f16f59d97
2 changed files with 14 additions and 7 deletions

View file

@ -252,7 +252,8 @@
(lambda (conn)
(with-statement-timeout
conn
fetch-high-level-table-size-metrics))))
fetch-high-level-table-size-metrics))
#:timeout 3))
#:unwind? #t))
(guix-revisions-count
(with-exception-handler
@ -268,7 +269,8 @@
(lambda (conn)
(with-statement-timeout
conn
count-guix-revisions))))
count-guix-revisions))
#:timeout 3))
#:unwind? #t))
(pg-stat-user-tables-metrics
(with-exception-handler
@ -284,7 +286,8 @@
(lambda (conn)
(with-statement-timeout
conn
fetch-pg-stat-user-tables-metrics))))
fetch-pg-stat-user-tables-metrics))
#:timeout 3))
#:unwind? #t))
(pg-stat-user-indexes-metrics
(with-exception-handler
@ -300,7 +303,8 @@
(lambda (conn)
(with-statement-timeout
conn
fetch-pg-stat-user-indexes-metrics))))
fetch-pg-stat-user-indexes-metrics))
#:timeout 3))
#:unwind? #t))
(pg-stats-metric-values
(with-exception-handler
@ -316,7 +320,8 @@
(lambda (conn)
(with-statement-timeout
conn
fetch-pg-stats-metrics))))
fetch-pg-stats-metrics))
#:timeout 3))
#:unwind? #t))
(load-new-guix-revision-job-metrics
(with-exception-handler
@ -332,10 +337,11 @@
(lambda (conn)
(with-statement-timeout
conn
select-load-new-guix-revision-job-metrics))))
select-load-new-guix-revision-job-metrics))
#:timeout 3))
#:unwind? #t)))
(for-each
(fibers-for-each
(match-lambda
((name . pool)
(for-each

View file

@ -223,6 +223,7 @@ port. Also, the port used can be changed by passing the --port option.\n"
#:destructor
(lambda (conn)
(close-postgresql-connection conn "web-reserved"))
#:default-max-waiters postgresql-connections
#:default-checkout-timeout 6
#:scheduler priority-scheduler)))