diff options
-rw-r--r-- | prometheus.scm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/prometheus.scm b/prometheus.scm index 464b546..68a3fa2 100644 --- a/prometheus.scm +++ b/prometheus.scm @@ -22,6 +22,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) #:use-module (ice-9 match) + #:use-module (ice-9 format) #:use-module (ice-9 threads) #:use-module (ice-9 exceptions) #:export (make-metrics-registry @@ -404,9 +405,9 @@ so that it can receive and store the metric values." (hash-for-each (lambda (label-values value) - (simple-format + (format port - "~A~A ~A\n" + "~a~a ~f\n" full-name (if (null? label-values) "" @@ -414,10 +415,15 @@ so that it can receive and store the metric values." "{" (string-join (map (match-lambda + ((label . (? number? value)) + (format + #f + "~a=\"~f\"" + label value)) ((label . value) - (simple-format + (format #f - "~A=\"~A\"" + "~a=\"~a\"" label value))) label-values) ",") |