Skip to content

Commit

Permalink
Use a less confusing name
Browse files Browse the repository at this point in the history
  • Loading branch information
lahsivjar committed Aug 31, 2023
1 parent fe46878 commit 07f6c45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions cmd/apmbench/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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")
}
8 changes: 4 additions & 4 deletions cmd/apmbench/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ 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")
}
collectorCfg.OTLPExporterEndpoint = apmURL.Host
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,
}
}
}
Expand Down

0 comments on commit 07f6c45

Please sign in to comment.