app/vmselect: handle the /custom-dashboards request from /graph/ page in the same way as from the /vmui/ page

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3322
This commit is contained in:
Aliaksandr Valialkin 2023-01-11 23:40:57 -08:00
parent 9fdd1a10c6
commit 9f5b5708ff
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -186,6 +186,13 @@ func RequestHandler(w http.ResponseWriter, r *http.Request) bool {
return true
case strings.HasPrefix(path, "/graph/"):
// This is needed for serving /graph URLs from Prometheus datasource in Grafana.
if path == "/graph/custom-dashboards" {
if err := handleVMUICustomDashboards(w); err != nil {
httpserver.Errorf(w, r, "%s", err)
return true
}
return true
}
r.URL.Path = strings.Replace(path, "/graph/", "/vmui/", 1)
vmuiFileServer.ServeHTTP(w, r)
return true