Created
February 26, 2018 03:44
-
-
Save tanan/97ce2c39f15cd5cfc85441f754228fd7 to your computer and use it in GitHub Desktop.
prometheus router setting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.Get("/", func(w http.ResponseWriter, r *http.Request) { | |
http.Redirect(w, r, path.Join(o.ExternalURL.Path, "/graph"), http.StatusFound) | |
}) | |
router.Get("/alerts", readyf(instrf("alerts", h.alerts))) | |
router.Get("/graph", readyf(instrf("graph", h.graph))) | |
router.Get("/status", readyf(instrf("status", h.status))) | |
router.Get("/flags", readyf(instrf("flags", h.flags))) | |
router.Get("/config", readyf(instrf("config", h.serveConfig))) | |
router.Get("/rules", readyf(instrf("rules", h.rules))) | |
router.Get("/targets", readyf(instrf("targets", h.targets))) | |
router.Get("/version", readyf(instrf("version", h.version))) | |
router.Get("/service-discovery", readyf(instrf("servicediscovery", h.serviceDiscovery))) | |
router.Get("/heap", instrf("heap", h.dumpHeap)) | |
router.Get("/metrics", prometheus.Handler().ServeHTTP) | |
router.Get("/federate", readyf(instrh("federate", httputil.CompressionHandler{ | |
Handler: http.HandlerFunc(h.federation), | |
}))) | |
router.Get("/consoles/*filepath", readyf(instrf("consoles", h.consoles))) | |
router.Get("/static/*filepath", instrf("static", h.serveStaticAsset)) | |
if o.UserAssetsPath != "" { | |
router.Get("/user/*filepath", instrf("user", route.FileServe(o.UserAssetsPath))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment