From 0fc06c7dad2904989fc8c48f5a20c46a60254e9b Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 4 Jul 2024 16:08:51 +0200 Subject: Instrument builds being submitted --- bffe/manage-builds.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bffe/manage-builds.scm b/bffe/manage-builds.scm index b5d95bd..80d79e2 100644 --- a/bffe/manage-builds.scm +++ b/bffe/manage-builds.scm @@ -517,6 +517,12 @@ specification #:key processed-commits-file) + (define build-submitted-counter-metric + (or (metrics-registry-fetch-metric metrics-registry + "build_submitted_total") + (make-counter-metric metrics-registry + "build_submitted_total"))) + (define processed-commits-hash (make-hash-table)) @@ -548,8 +554,10 @@ (assoc-ref response "no-build-submitted"))) (if no-build-submitted-response (log-msg 'DEBUG log-prefix "skipped: " no-build-submitted-response) - (log-msg 'DEBUG log-prefix "build submitted as " - (assoc-ref response "build-submitted")))))) + (begin + (metric-increment build-submitted-counter-metric) + (log-msg 'DEBUG log-prefix "build submitted as " + (assoc-ref response "build-submitted"))))))) ;; The TTL Guix uses for transient failures fetching substitutes is 10 ;; minutes, so we need to retry for longer than that #:times 30 -- cgit v1.2.3