Skip to content

Commit

Permalink
Rename collAgentAddr into agentURL
Browse files Browse the repository at this point in the history
  • Loading branch information
nsavoire committed Nov 4, 2024
1 parent b4356b9 commit acbc8f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cli_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (
type arguments struct {
bpfVerifierLogLevel uint64
bpfVerifierLogSize uint64
collAgentAddr string
agentURL string
copyright bool
mapScaleFactor uint64
monitorInterval time.Duration
Expand Down Expand Up @@ -109,7 +109,7 @@ func parseArgs() (*arguments, error) {
Aliases: []string{"U"},
Value: defaultArgAgentURL,
Usage: "The Datadog trace agent URL in the format of http://host:port.",
Destination: &args.collAgentAddr,
Destination: &args.agentURL,
Sources: cli.EnvVars("DD_HOST_PROFILING_TRACE_AGENT_URL", "DD_TRACE_AGENT_URL"),
},
&cli.StringFlag{
Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func mainWithExitCode() exitCode {
return failure("Failed to parse the included tracers: %v", err)
}

metadataCollector := hostmetadata.NewCollector(args.collAgentAddr)
metadataCollector := hostmetadata.NewCollector(args.agentURL)
metadataCollector.AddCustomData("os.type", "linux")

kernelVersion, err := getKernelVersion()
Expand All @@ -158,7 +158,7 @@ func mainWithExitCode() exitCode {
metadataCollector.AddCustomData("os.kernel.release", kernelVersion)

// hostname and sourceIP will be populated from the root namespace.
hostname, sourceIP, err := getHostnameAndSourceIP(args.collAgentAddr)
hostname, sourceIP, err := getHostnameAndSourceIP(args.agentURL)
if err != nil {
log.Warnf("Failed to fetch metadata information in the root namespace: %v", err)
}
Expand Down Expand Up @@ -189,9 +189,9 @@ func mainWithExitCode() exitCode {
}
apiKey = args.apiKey
} else {
intakeURL, err = intakeURLForAgent(args.collAgentAddr)
intakeURL, err = intakeURLForAgent(args.agentURL)
if err != nil {
return failure("Failed to get intake URL from agent URL %v: %v", args.collAgentAddr, err)
return failure("Failed to get intake URL from agent URL %v: %v", args.agentURL, err)
}
}

Expand Down

0 comments on commit acbc8f8

Please sign in to comment.