mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
406f4fe445
Pass `-remoteWrite.showURL` command-line flag in order to see real `-remoteWrite.url` values in logs and at `/metrics` page. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/773
23 lines
522 B
Go
23 lines
522 B
Go
package logger
|
|
|
|
import (
|
|
"flag"
|
|
"strings"
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo"
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/flagutil"
|
|
)
|
|
|
|
func logAllFlags() {
|
|
Infof("build version: %s", buildinfo.Version)
|
|
Infof("command line flags")
|
|
flag.VisitAll(func(f *flag.Flag) {
|
|
lname := strings.ToLower(f.Name)
|
|
value := f.Value.String()
|
|
if flagutil.IsSecretFlag(lname) {
|
|
// Do not expose passwords and keys to prometheus.
|
|
value = "secret"
|
|
}
|
|
Infof("flag %q = %q", f.Name, value)
|
|
})
|
|
}
|