mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-15 19:41:02 +00:00
Add a CLI flag to configure the service name
This commit is contained in:
@@ -203,7 +203,7 @@ func appMain(flags appFlags) {
|
||||
setLogFormatter(flags.logPrefix)
|
||||
runtime.SetBlockProfileRate(flags.blockProfileRate)
|
||||
|
||||
traceCloser := tracing.NewFromEnv("scope-app")
|
||||
traceCloser := tracing.NewFromEnv(fmt.Sprintf("scope-%s", flags.serviceName))
|
||||
defer traceCloser.Close()
|
||||
|
||||
defer log.Info("app exiting")
|
||||
|
||||
@@ -167,6 +167,7 @@ type appFlags struct {
|
||||
userIDHeader string
|
||||
externalUI bool
|
||||
metricsGraphURL string
|
||||
serviceName string
|
||||
|
||||
blockProfileRate int
|
||||
|
||||
@@ -369,6 +370,7 @@ func setupFlags(flags *flags) {
|
||||
flag.StringVar(&flags.app.userIDHeader, "app.userid.header", "", "HTTP header to use as userid")
|
||||
flag.BoolVar(&flags.app.externalUI, "app.externalUI", false, "Point to externally hosted static UI assets")
|
||||
flag.StringVar(&flags.app.metricsGraphURL, "app.metrics-graph", "", "Enable extended metrics graph by providing a templated URL (supports :orgID and :query). Example: --app.metric-graph=/prom/:orgID/notebook/new")
|
||||
flag.StringVar(&flags.app.serviceName, "app.service-name", "app", "The name for this service which should be reported in instrumentation")
|
||||
|
||||
flag.IntVar(&flags.app.blockProfileRate, "app.block.profile.rate", 0, "If more than 0, enable block profiling. The profiler aims to sample an average of one blocking event per rate nanoseconds spent blocked.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user