aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-24 00:10:31 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-24 00:10:31 +0800
commitbb3b881a0cef2248e15452ed1eead630b9ba0f75 (patch)
treebc6c270c8f3193010cf7f1f0be2c0211cd843106 /main.go
parentReuse the cache for /tree (diff)
downloadforge-bb3b881a0cef2248e15452ed1eead630b9ba0f75.tar.gz
forge-bb3b881a0cef2248e15452ed1eead630b9ba0f75.tar.zst
forge-bb3b881a0cef2248e15452ed1eead630b9ba0f75.zip
Add prometheus
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.go b/main.go
index 444e5b0..89a8608 100644
--- a/main.go
+++ b/main.go
@@ -11,6 +11,7 @@ import (
"syscall"
"time"
+ "github.com/prometheus/client_golang/prometheus/promhttp"
"go.lindenii.runxiyu.org/lindenii-common/clog"
)
@@ -103,5 +104,9 @@ func main() {
// IRC bot
go ircBotLoop()
+ // Prometheus
+ http.Handle("/metrics", promhttp.Handler())
+ go http.ListenAndServe(":9112", nil)
+
select {}
}