aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-07-04 16:08:51 +0200
committerChristopher Baines <mail@cbaines.net>2024-07-04 16:08:51 +0200
commit0fc06c7dad2904989fc8c48f5a20c46a60254e9b (patch)
treecb51d290086a0f7668d7c349700b3a6f7e1dc4dd
parent7df2aa647d11342e3a446f44ef7626e58a1d5902 (diff)
downloadbffe-0fc06c7dad2904989fc8c48f5a20c46a60254e9b.tar
bffe-0fc06c7dad2904989fc8c48f5a20c46a60254e9b.tar.gz
Instrument builds being submitted
-rw-r--r--bffe/manage-builds.scm12
1 files 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