mirror of
https://github.com/prometheus/prometheus.git
synced 2025-11-29 06:31:01 +01:00
Fix pathPrefix bug from PR-4025
This commit is contained in:
parent
61accb51ac
commit
cd2820e165
@ -666,7 +666,13 @@ func tmplFuncs(consolesPath string, opts *Options) template_text.FuncMap {
|
|||||||
return time.Since(t) / time.Millisecond * time.Millisecond
|
return time.Since(t) / time.Millisecond * time.Millisecond
|
||||||
},
|
},
|
||||||
"consolesPath": func() string { return consolesPath },
|
"consolesPath": func() string { return consolesPath },
|
||||||
"pathPrefix": func() string { return opts.RoutePrefix },
|
"pathPrefix": func() string {
|
||||||
|
if opts.RoutePrefix == "/" {
|
||||||
|
return ""
|
||||||
|
} else {
|
||||||
|
return opts.RoutePrefix
|
||||||
|
}
|
||||||
|
},
|
||||||
"buildVersion": func() string { return opts.Version.Revision },
|
"buildVersion": func() string { return opts.Version.Revision },
|
||||||
"stripLabels": func(lset map[string]string, labels ...string) map[string]string {
|
"stripLabels": func(lset map[string]string, labels ...string) map[string]string {
|
||||||
for _, ln := range labels {
|
for _, ln := range labels {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user