aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2025-02-25 09:24:17 +0000
committerChristopher Baines <mail@cbaines.net>2025-02-25 09:24:17 +0000
commitc8a641846ac4ed3bd883861cefca1758a2a05ff8 (patch)
treedf1a2ca404fce15a4b6a4c1db40d8aeeab9a89e4
parent4782dcc6b6bbedfa6d1da03fc4e10d42ac767d5d (diff)
downloadqa-frontpage-c8a641846ac4ed3bd883861cefca1758a2a05ff8.tar
qa-frontpage-c8a641846ac4ed3bd883861cefca1758a2a05ff8.tar.gz
Enable and instrument core dumps
-rw-r--r--scripts/guix-qa-frontpage.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/guix-qa-frontpage.in b/scripts/guix-qa-frontpage.in
index 89d1ecb..4e1aa2e 100644
--- a/scripts/guix-qa-frontpage.in
+++ b/scripts/guix-qa-frontpage.in
@@ -276,6 +276,22 @@
(setup-database (assq-ref opts 'database)
metrics-registry)))
+ (with-exception-handler
+ (lambda (exn)
+ (simple-format #t "failed enabling core dumps: ~A\n" exn))
+ (lambda ()
+ (setrlimit 'core #f #f))
+ #:unwind? #t)
+
+ (let ((core-file
+ (string-append (getcwd) "/core"))
+ (metric
+ (make-gauge-metric metrics-registry
+ "core_dump_file_last_modified_seconds")))
+ (when (file-exists? core-file)
+ (metric-set metric
+ (stat:mtime (stat core-file)))))
+
(start-guix-qa-frontpage
(assq-ref opts 'port)
(assq-ref opts 'host)