2
0
mirror of https://github.com/hibiken/asynqmon.git synced 2025-10-26 16:26:12 +08:00

Add support for Prometheus integration

This commit is contained in:
Ken Hibino
2021-12-19 07:30:16 -08:00
committed by GitHub
parent 711ca8b5c8
commit 1b8d46a35e
30 changed files with 2113 additions and 105 deletions

View File

@@ -15,10 +15,11 @@ import (
// the path to the index file within that static directory are used to
// serve the SPA.
type uiAssetsHandler struct {
rootPath string
contents embed.FS
staticDirPath string
indexFileName string
rootPath string
contents embed.FS
staticDirPath string
indexFileName string
prometheusAddr string
}
// ServeHTTP inspects the URL path to locate a file within the static dir
@@ -59,9 +60,11 @@ func (h *uiAssetsHandler) renderIndexFile(w http.ResponseWriter) error {
return err
}
data := struct {
RootPath string
RootPath string
PrometheusAddr string
}{
RootPath: h.rootPath,
RootPath: h.rootPath,
PrometheusAddr: h.prometheusAddr,
}
return tmpl.Execute(w, data)
}