aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-04-17 20:40:53 +0100
committerChristopher Baines <mail@cbaines.net>2022-04-17 20:40:53 +0100
commit35c69f37d8fc75c247831cc4a287c5b747b51d84 (patch)
tree1d36d7dc6afc3f413af4b16fb491cff185a91a8b /scripts
parent3f732ba58b1720410aeaff0b87e3dd0e54a6fa5d (diff)
downloadnar-herder-35c69f37d8fc75c247831cc4a287c5b747b51d84.tar
nar-herder-35c69f37d8fc75c247831cc4a287c5b747b51d84.tar.gz
Add support for exposing some basic metrics
In a format understood by Prometheus.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/nar-herder.in9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in
index fd4b7b4..b0c4498 100644
--- a/scripts/nar-herder.in
+++ b/scripts/nar-herder.in
@@ -45,6 +45,7 @@
(oop goops)
(logging logger)
(logging port-log)
+ (prometheus)
(fibers)
(fibers conditions)
(fibers web server)
@@ -270,7 +271,10 @@
(format #f "~a (~5a): ~a~%"
(strftime "%F %H:%M:%S" (localtime time))
lvl
- str)))))
+ str))))
+ (metrics-registry (make-metrics-registry
+ #:namespace
+ "narherder")))
(define (download-database)
(let ((database-uri
@@ -383,6 +387,7 @@
canonical-storage
#:ttl (assq-ref opts 'narinfo-ttl)
#:negative-ttl (assq-ref opts 'narinfo-negative-ttl)
- #:logger lgr)
+ #:logger lgr
+ #:metrics-registry metrics-registry)
#:host (assq-ref opts 'host)
#:port (assq-ref opts 'port))))))