From fe739a3a12dd2ffb2ebc91f31cc0542bfc0c12f5 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Wed, 27 Sep 2023 11:00:39 -0400 Subject: create contact page Signed-off-by: Xe Iaso --- xesite/github.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xesite/github.go') diff --git a/xesite/github.go b/xesite/github.go index 054108f..bde7c9d 100644 --- a/xesite/github.go +++ b/xesite/github.go @@ -16,11 +16,12 @@ import ( ) var ( - webhookCount = expvar.NewInt("gauge_xesite_webhook_ingress") + webhookCount = metrics.LabelMap{Label: "source"} buildErrors = metrics.LabelMap{Label: "err"} ) func init() { + expvar.Publish("gauge_xesite_webhook_count", &webhookCount) expvar.Publish("gauge_xesite_build_errors", &buildErrors) } @@ -29,7 +30,7 @@ type GitHubWebhook struct { } func (gh *GitHubWebhook) ServeHTTP(w http.ResponseWriter, r *http.Request) { - webhookCount.Add(1) + webhookCount.Add("github", 1) if r.Header.Get("X-GitHub-Event") != "push" { slog.Info("not a push event", "event", r.Header.Get("X-GitHub-Event")) -- cgit v1.2.3