Skip to content

Commit

Permalink
internal/telemetry: revert hostname.Get() -> os.Hostname() (#3101)
Browse files Browse the repository at this point in the history
Signed-off-by: Eliott Bouhana <[email protected]>
  • Loading branch information
eliottness authored and RomainMuller committed Jan 20, 2025
1 parent 45978f8 commit 7a2fbad
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/telemetry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"fmt"
"net"
"net/http"
"os"
"runtime"
"runtime/debug"
"strings"
Expand All @@ -21,7 +22,6 @@ import (

"gopkg.in/DataDog/dd-trace-go.v1/internal"
"gopkg.in/DataDog/dd-trace-go.v1/internal/globalconfig"
"gopkg.in/DataDog/dd-trace-go.v1/internal/hostname"
logger "gopkg.in/DataDog/dd-trace-go.v1/internal/log"
"gopkg.in/DataDog/dd-trace-go.v1/internal/osinfo"
"gopkg.in/DataDog/dd-trace-go.v1/internal/version"
Expand Down Expand Up @@ -79,9 +79,16 @@ var (

// LogPrefix specifies the prefix for all telemetry logging
LogPrefix = "Instrumentation telemetry: "

hostname string
)

func init() {
var err error
hostname, err = os.Hostname()
if err != nil {
hostname = "unknown"
}
GlobalClient = new(client)
}

Expand Down Expand Up @@ -459,7 +466,6 @@ func (c *client) flush(sync bool) {
// sent through this Client
func (c *client) newRequest(t RequestType) *Request {
c.seqID++
hostname := hostname.Get()
body := &Body{
APIVersion: "v2",
RequestType: t,
Expand Down

0 comments on commit 7a2fbad

Please sign in to comment.