From 07f6c456d2c1fcd1474410dc8f417433a858b77a Mon Sep 17 00:00:00 2001 From: Vishal Raj Date: Thu, 31 Aug 2023 10:43:08 +0800 Subject: [PATCH] Use a less confusing name --- cmd/apmbench/config.go | 14 +++++++------- cmd/apmbench/main.go | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/apmbench/config.go b/cmd/apmbench/config.go index 3fe8d70..3d87ccb 100644 --- a/cmd/apmbench/config.go +++ b/cmd/apmbench/config.go @@ -19,11 +19,11 @@ var cfg struct { Benchtime time.Duration RunRE *regexp.Regexp // Sorted list of agents count to be used for benchmarking - AgentsList []int - CollectorConfigYaml string - ServerMode bool - APMServerURL string - APMSecretToken string + AgentsList []int + CollectorConfigYaml string + ServerMode bool + MonitoringAPMServerURL string + MonitoringAPMSecretToken string } func init() { @@ -62,6 +62,6 @@ func init() { ) flag.StringVar(&cfg.CollectorConfigYaml, "collector-config-yaml", "", "configuration for otel collector") flag.BoolVar(&cfg.ServerMode, "server-mode", false, "continue running otel collector post benchmark run") - flag.StringVar(&cfg.APMServerURL, "apm-server-url", "", "monitoring APM server URL") - flag.StringVar(&cfg.APMSecretToken, "apm-secret-token", "", "monitoring APM secret token") + flag.StringVar(&cfg.MonitoringAPMServerURL, "monitoring-apm-server-url", "", "monitoring APM server URL") + flag.StringVar(&cfg.MonitoringAPMSecretToken, "monitoring-apm-secret-token", "", "monitoring APM secret token") } diff --git a/cmd/apmbench/main.go b/cmd/apmbench/main.go index 1b43565..e9584ae 100644 --- a/cmd/apmbench/main.go +++ b/cmd/apmbench/main.go @@ -31,8 +31,8 @@ func main() { // Create otel collector collectorCfg := otelcollector.DefaultConfig() - if cfg.APMServerURL != "" { - apmURL, err := url.Parse(cfg.APMServerURL) + if cfg.MonitoringAPMServerURL != "" { + apmURL, err := url.Parse(cfg.MonitoringAPMServerURL) if err != nil { logger.Fatal("invalid apm-server-url specified") } @@ -40,9 +40,9 @@ func main() { if apmURL.Port() == "" { collectorCfg.OTLPExporterEndpoint += ":443" } - if cfg.APMSecretToken != "" { + if cfg.MonitoringAPMSecretToken != "" { collectorCfg.OTLPExporterHeaders = map[string]string{ - "Authorization": "Bearer " + cfg.APMSecretToken, + "Authorization": "Bearer " + cfg.MonitoringAPMSecretToken, } } }