aboutsummaryrefslogtreecommitdiff
path: root/xesite/github.go
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2023-09-27 11:00:39 -0400
committerXe Iaso <me@xeiaso.net>2023-09-27 11:00:39 -0400
commitfe739a3a12dd2ffb2ebc91f31cc0542bfc0c12f5 (patch)
treec20cc65606fa5a38dd27919dfcf01edcc2aaf82e /xesite/github.go
parent079c84a928783c5c370634516a440110d9fa793d (diff)
downloadxesite-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.go5
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"))