diff options
author | Christopher Baines <mail@cbaines.net> | 2024-07-12 10:21:39 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-07-12 10:27:45 +0100 |
commit | 492d4628887ea726cedc1c2b55743acfe32dfe0c (patch) | |
tree | 5d62d40be63692ad7b5a1b74a4016e51b4cf9404 /guix-build-coordinator | |
parent | 8273f915692fcda1b28e4c69ed399ff50d8550b8 (diff) | |
download | build-coordinator-492d4628887ea726cedc1c2b55743acfe32dfe0c.tar build-coordinator-492d4628887ea726cedc1c2b55743acfe32dfe0c.tar.gz |
Track errors when reading/substituting derivations
Diffstat (limited to 'guix-build-coordinator')
-rw-r--r-- | guix-build-coordinator/client-communication.scm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/guix-build-coordinator/client-communication.scm b/guix-build-coordinator/client-communication.scm index bffec12..47a289d 100644 --- a/guix-build-coordinator/client-communication.scm +++ b/guix-build-coordinator/client-communication.scm @@ -32,6 +32,7 @@ #:use-module (json) #:use-module (logging logger) #:use-module (gcrypt random) + #:use-module (prometheus) #:use-module (web uri) #:use-module (web client) #:use-module (web request) @@ -100,6 +101,14 @@ (json-string->scm (utf8->string raw-body)) '())) + (define read-drv-error-count-metric + (or (metrics-registry-fetch-metric + (build-coordinator-metrics-registry build-coordinator) + "read_derivation_error_total") + (make-counter-metric + (build-coordinator-metrics-registry build-coordinator) + "read_derivation_error_total"))) + (define (controller-thunk) (match method-and-path-components (('GET "build" uuid) @@ -514,8 +523,11 @@ (retry-on-error (lambda () (read-drv/substitute derivation-file)) - #:times 5 - #:delay 5)) + #:times 2 + #:delay 3 + #:error-hook + (lambda _ + (metric-increment read-drv-error-count-metric)))) (lambda args (backtrace)))) #:unwind? #t)) |