diff options
Diffstat (limited to 'guix-build-coordinator/agent-messaging/http.scm')
-rw-r--r-- | guix-build-coordinator/agent-messaging/http.scm | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/guix-build-coordinator/agent-messaging/http.scm b/guix-build-coordinator/agent-messaging/http.scm index 54a04ee..b74e114 100644 --- a/guix-build-coordinator/agent-messaging/http.scm +++ b/guix-build-coordinator/agent-messaging/http.scm @@ -178,7 +178,8 @@ port. Also, the port used can be changed by passing the --port option.\n" (unprocessed-hook-events-total (make-gauge-metric registry (string-append namespace - "_unprocessed_hook_events_total")))) + "_unprocessed_hook_events_total") + #:labels '(event)))) (define (zero-metric-for-agents metric) (for-each (lambda (agent-details) (metric-set metric @@ -224,8 +225,19 @@ port. Also, the port used can be changed by passing the --port option.\n" `((agent_id . ,agent-id))))) (datastore-count-build-allocation-plan-entries datastore)) - (metric-set unprocessed-hook-events-total - (datastore-count-unprocessed-hook-events datastore))))) + (for-each (match-lambda + ((event . _) + (metric-set unprocessed-hook-events-total + 0 + #:label-values + `((event . ,event))))) + (build-coordinator-hooks build-coordinator)) + (for-each (lambda (event-count) + (metric-set unprocessed-hook-events-total + (assq-ref event-count 'count) + #:label-values + `((event . ,(assq-ref event-count 'event))))) + (datastore-count-unprocessed-hook-events datastore))))) (define (controller request method-and-path-components |