adds custom apiPathLinks for victoria-metrics / api help (#968)

* adds custom apiPathLinks for victoria-metrics / api help

* adds custom paths for PMM
This commit is contained in:
Nikolay 2020-12-15 15:20:51 +03:00 committed by GitHub
parent f9c706e186
commit 0ff0787797
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,6 +32,12 @@ var (
"Unknown config entries are allowed in -promscrape.config by default. This can be changed with -promscrape.config.strictParse")
)
// custom api help links [["/api","doc"]] without http.pathPrefix.
var customAPIPathList = [][]string{
{"/graph/explore", "explore metrics grafana page"},
{"/graph/d/prometheus-advanced/advanced-data-exploration", "PMM grafana dashboard"},
}
func main() {
// Write flags and help message to stdout, since it is easier to grep or pipe.
flag.CommandLine.SetOutput(os.Stdout)
@ -114,4 +120,8 @@ func writeAPIHelp(w io.Writer, pathList [][]string) {
p = path.Join(pathPrefix, p)
fmt.Fprintf(w, "<a href='%s'>%q</a> - %s<br/>", p, p, doc)
}
for _, p := range customAPIPathList {
p, doc := p[0], p[1]
fmt.Fprintf(w, "<a href='%s'>%q</a> - %s<br/>", p, p, doc)
}
}