diff options
| author | Xe Iaso <me@xeiaso.net> | 2023-09-27 11:00:39 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2023-09-27 11:00:39 -0400 |
| commit | fe739a3a12dd2ffb2ebc91f31cc0542bfc0c12f5 (patch) | |
| tree | c20cc65606fa5a38dd27919dfcf01edcc2aaf82e /xesite/github.go | |
| parent | 079c84a928783c5c370634516a440110d9fa793d (diff) | |
| download | xesite-fe739a3a12dd2ffb2ebc91f31cc0542bfc0c12f5.tar.xz xesite-fe739a3a12dd2ffb2ebc91f31cc0542bfc0c12f5.zip | |
create contact page
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'xesite/github.go')
| -rw-r--r-- | xesite/github.go | 5 |
1 files changed, 3 insertions, 2 deletions
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")) |
