Skip to content
Snippets Groups Projects
Verified Commit c272abfc authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

feat: export prometheus metrics from asynq

parent db8aa616
No related branches found
No related tags found
No related merge requests found
Pipeline #2828 failed
......@@ -5,8 +5,11 @@ import (
"database/sql"
"git.kuschku.de/justjanne/imghost/shared"
"github.com/hibiken/asynq"
"github.com/hibiken/asynq/x/metrics"
"github.com/hibiken/asynqmon"
_ "github.com/lib/pq"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"log"
"mime"
"net/http"
......@@ -53,6 +56,10 @@ func main() {
)
http.Handle(monitor.RootPath()+"/", monitor)
reg := prometheus.NewPedanticRegistry()
reg.MustRegister(metrics.NewQueueMetricsCollector(asynq.NewInspector(config.AsynqOpts())))
http.Handle("/metrics", promhttp.HandlerFor(reg, promhttp.HandlerOpts{}))
http.Handle("/upload/", pageUpload(pageContext))
http.Handle("/i/", http.StripPrefix("/i/", pageImageDetail(pageContext)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment