mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 03:05:53 +08:00
add root path command options
This commit is contained in:
parent
1597dac66e
commit
abbdef354f
@ -38,6 +38,7 @@ type Config struct {
|
|||||||
ReadOnly bool
|
ReadOnly bool
|
||||||
MaxPayloadLength int
|
MaxPayloadLength int
|
||||||
MaxResultLength int
|
MaxResultLength int
|
||||||
|
RootPath string
|
||||||
|
|
||||||
// Prometheus related configs
|
// Prometheus related configs
|
||||||
EnableMetricsExporter bool
|
EnableMetricsExporter bool
|
||||||
@ -72,6 +73,7 @@ func parseFlags(progname string, args []string) (cfg *Config, output string, err
|
|||||||
flags.BoolVar(&conf.EnableMetricsExporter, "enable-metrics-exporter", getEnvOrDefaultBool("ENABLE_METRICS_EXPORTER", false), "enable prometheus metrics exporter to expose queue metrics")
|
flags.BoolVar(&conf.EnableMetricsExporter, "enable-metrics-exporter", getEnvOrDefaultBool("ENABLE_METRICS_EXPORTER", false), "enable prometheus metrics exporter to expose queue metrics")
|
||||||
flags.StringVar(&conf.PrometheusServerAddr, "prometheus-addr", getEnvDefaultString("PROMETHEUS_ADDR", ""), "address of prometheus server to query time series")
|
flags.StringVar(&conf.PrometheusServerAddr, "prometheus-addr", getEnvDefaultString("PROMETHEUS_ADDR", ""), "address of prometheus server to query time series")
|
||||||
flags.BoolVar(&conf.ReadOnly, "read-only", getEnvOrDefaultBool("READ_ONLY", false), "restrict to read-only mode")
|
flags.BoolVar(&conf.ReadOnly, "read-only", getEnvOrDefaultBool("READ_ONLY", false), "restrict to read-only mode")
|
||||||
|
flags.StringVar(&conf.RootPath, "root-path", "/", "path for homepage of asynqmon")
|
||||||
|
|
||||||
err = flags.Parse(args)
|
err = flags.Parse(args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -153,6 +155,7 @@ func main() {
|
|||||||
ResultFormatter: asynqmon.ResultFormatterFunc(resultFormatterFunc(cfg)),
|
ResultFormatter: asynqmon.ResultFormatterFunc(resultFormatterFunc(cfg)),
|
||||||
PrometheusAddress: cfg.PrometheusServerAddr,
|
PrometheusAddress: cfg.PrometheusServerAddr,
|
||||||
ReadOnly: cfg.ReadOnly,
|
ReadOnly: cfg.ReadOnly,
|
||||||
|
RootPath: cfg.RootPath,
|
||||||
})
|
})
|
||||||
defer h.Close()
|
defer h.Close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user