diff --git a/contrib/database/sql/option_test.go b/contrib/database/sql/option_test.go index e04c5ef452..469bc48736 100644 --- a/contrib/database/sql/option_test.go +++ b/contrib/database/sql/option_test.go @@ -69,7 +69,7 @@ func TestCheckStatsdRequired(t *testing.T) { cfg := new(config) cfg.dbStats = true cfg.checkStatsdRequired() - _, ok := cfg.statsdClient.(*statsd.Client) + _, ok := cfg.statsdClient.(*statsd.ClientDirect) assert.True(t, ok) }) t.Run("invalid address", func(t *testing.T) { diff --git a/ddtrace/mocktracer/mocktracer.go b/ddtrace/mocktracer/mocktracer.go index 2a210e07bb..396d99bf20 100644 --- a/ddtrace/mocktracer/mocktracer.go +++ b/ddtrace/mocktracer/mocktracer.go @@ -80,7 +80,7 @@ func newMockTracer() *mocktracer { client := &http.Client{ Transport: t.dsmTransport, } - t.dsmProcessor = datastreams.NewProcessor(&statsd.NoOpClient{}, "env", "service", "v1", &url.URL{Scheme: "http", Host: "agent-address"}, client) + t.dsmProcessor = datastreams.NewProcessor(&statsd.NoOpClientDirect{}, "env", "service", "v1", &url.URL{Scheme: "http", Host: "agent-address"}, client) t.dsmProcessor.Start() t.dsmProcessor.Flush() return &t diff --git a/ddtrace/tracer/option.go b/ddtrace/tracer/option.go index ae2594aa50..fd42e3c4e4 100644 --- a/ddtrace/tracer/option.go +++ b/ddtrace/tracer/option.go @@ -802,7 +802,7 @@ func statsTags(c *config) []string { // withNoopStats is used for testing to disable statsd client func withNoopStats() StartOption { return func(c *config) { - c.statsdClient = &statsd.NoOpClient{} + c.statsdClient = &statsd.NoOpClientDirect{} } } diff --git a/ddtrace/tracer/stats.go b/ddtrace/tracer/stats.go index a3bdfc9d32..bf8530a8d6 100644 --- a/ddtrace/tracer/stats.go +++ b/ddtrace/tracer/stats.go @@ -132,7 +132,7 @@ func (c *concentrator) runFlusher(tick <-chan time.Time) { // statsd returns any tracer configured statsd client, or a no-op. func (c *concentrator) statsd() internal.StatsdClient { if c.statsdClient == nil { - return &statsd.NoOpClient{} + return &statsd.NoOpClientDirect{} } return c.statsdClient } diff --git a/ddtrace/tracer/stats_test.go b/ddtrace/tracer/stats_test.go index e9c56d8732..42f0bc17b0 100644 --- a/ddtrace/tracer/stats_test.go +++ b/ddtrace/tracer/stats_test.go @@ -41,7 +41,7 @@ func TestConcentrator(t *testing.T) { } t.Run("start-stop", func(t *testing.T) { assert := assert.New(t) - c := newConcentrator(&config{}, bucketSize, &statsd.NoOpClient{}) + c := newConcentrator(&config{}, bucketSize, &statsd.NoOpClientDirect{}) assert.EqualValues(atomic.LoadUint32(&c.stopped), 1) c.Start() assert.EqualValues(atomic.LoadUint32(&c.stopped), 0) @@ -60,7 +60,7 @@ func TestConcentrator(t *testing.T) { t.Run("flusher", func(t *testing.T) { t.Run("old", func(t *testing.T) { transport := newDummyTransport() - c := newConcentrator(&config{transport: transport, env: "someEnv"}, 500_000, &statsd.NoOpClient{}) + c := newConcentrator(&config{transport: transport, env: "someEnv"}, 500_000, &statsd.NoOpClientDirect{}) assert.Len(t, transport.Stats(), 0) ss1, ok := c.newTracerStatSpan(&s1, nil) assert.True(t, ok) @@ -105,7 +105,7 @@ func TestConcentrator(t *testing.T) { t.Run("ciGitSha", func(t *testing.T) { utils.AddCITags(constants.GitCommitSHA, "DEADBEEF") transport := newDummyTransport() - c := newConcentrator(&config{transport: transport, env: "someEnv"}, (10 * time.Second).Nanoseconds(), &statsd.NoOpClient{}) + c := newConcentrator(&config{transport: transport, env: "someEnv"}, (10 * time.Second).Nanoseconds(), &statsd.NoOpClientDirect{}) assert.Len(t, transport.Stats(), 0) ss1, ok := c.newTracerStatSpan(&s1, nil) assert.True(t, ok) @@ -119,7 +119,7 @@ func TestConcentrator(t *testing.T) { // stats should be sent if the concentrator is stopped t.Run("stop", func(t *testing.T) { transport := newDummyTransport() - c := newConcentrator(&config{transport: transport}, 500000, &statsd.NoOpClient{}) + c := newConcentrator(&config{transport: transport}, 500000, &statsd.NoOpClientDirect{}) assert.Len(t, transport.Stats(), 0) ss1, ok := c.newTracerStatSpan(&s1, nil) assert.True(t, ok) diff --git a/ddtrace/tracer/textmap_test.go b/ddtrace/tracer/textmap_test.go index 35a84523aa..74038fc0c7 100644 --- a/ddtrace/tracer/textmap_test.go +++ b/ddtrace/tracer/textmap_test.go @@ -671,7 +671,7 @@ func TestEnvVars(t *testing.T) { } for _, test := range tests { t.Run(fmt.Sprintf("inject with env=%q", testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() root := tracer.StartSpan("web.request").(*span) ctx, ok := root.Context().(*spanContext) @@ -743,7 +743,7 @@ func TestEnvVars(t *testing.T) { } for _, test := range tests { t.Run(fmt.Sprintf("extract with env=%q", testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) ctx, err := tracer.Extract(test.in) @@ -782,7 +782,7 @@ func TestEnvVars(t *testing.T) { } for _, tc := range tests { t.Run(fmt.Sprintf("extract with env=%q", testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) _, err := tracer.Extract(tc.in) @@ -839,7 +839,7 @@ func TestEnvVars(t *testing.T) { } for _, tc := range tests { t.Run(fmt.Sprintf("extract with env=%q", testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) ctx, err := tracer.Extract(tc.in) @@ -876,7 +876,7 @@ func TestEnvVars(t *testing.T) { } for i, tc := range tests { t.Run(fmt.Sprintf("b3 single header inject #%d", i), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() root := tracer.StartSpan("myrequest").(*span) ctx, ok := root.Context().(*spanContext) @@ -934,7 +934,7 @@ func TestEnvVars(t *testing.T) { } for _, tc := range tests { t.Run(fmt.Sprintf("inject with env=%q", testEnv), func(t *testing.T) { - tracer := newTracer(WithPropagator(NewPropagator(&PropagatorConfig{B3: true})), WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithPropagator(NewPropagator(&PropagatorConfig{B3: true})), WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() root := tracer.StartSpan("web.request").(*span) ctx, ok := root.Context().(*spanContext) @@ -1009,7 +1009,7 @@ func TestEnvVars(t *testing.T) { } for _, tc := range tests { t.Run(fmt.Sprintf("extract with env=%q", testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) @@ -1069,7 +1069,7 @@ func TestEnvVars(t *testing.T) { } for _, tc := range tests { t.Run(fmt.Sprintf("inject and extract with env=%q", testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() root := tracer.StartSpan("web.request").(*span) root.SetTag(ext.SamplingPriority, -1) @@ -1281,7 +1281,7 @@ func TestEnvVars(t *testing.T) { } for i, tc := range tests { t.Run(fmt.Sprintf("#%v extract/valid with env=%q", i, testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) ctx, err := tracer.Extract(tc.in) @@ -1337,7 +1337,7 @@ func TestEnvVars(t *testing.T) { for i, tc := range tests { t.Run(fmt.Sprintf("#%v extract/invalid with env=%q", i, testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) ctx, err := tracer.Extract(tc) @@ -1389,7 +1389,7 @@ func TestEnvVars(t *testing.T) { } for i, tc := range tests { t.Run(fmt.Sprintf("#%v extract/valid with env=%q", i, testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) ctx, err := tracer.Extract(tc.inHeaders) @@ -1591,7 +1591,7 @@ func TestEnvVars(t *testing.T) { } for i, tc := range tests { t.Run(fmt.Sprintf("#%d w3c inject with env=%q", i, testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) root := tracer.StartSpan("web.request").(*span) @@ -1621,7 +1621,7 @@ func TestEnvVars(t *testing.T) { }) t.Run(fmt.Sprintf("w3c inject with env=%q / testing tag list-member limit", testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) root := tracer.StartSpan("web.request").(*span) @@ -1689,7 +1689,7 @@ func TestEnvVars(t *testing.T) { } for i, tc := range tests { t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) ctx, err := tracer.Extract(tc.inHeaders) @@ -1764,7 +1764,7 @@ func TestEnvVars(t *testing.T) { } for i, tc := range tests { t.Run(fmt.Sprintf("#%d w3c inject/extract with env=%q", i, testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) ctx, err := tracer.Extract(tc.in) @@ -1828,7 +1828,7 @@ func TestEnvVars(t *testing.T) { } for i, tc := range tests { t.Run(fmt.Sprintf("#%d w3c inject/extract with env=%q", i, testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) pCtx, err := tracer.Extract(tc.in) @@ -1911,7 +1911,7 @@ func TestEnvVars(t *testing.T) { } for i, tc := range tests { t.Run(fmt.Sprintf("#%v extract with env=%q", i, testEnv), func(t *testing.T) { - tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClient{})) + tracer := newTracer(WithHTTPClient(c), withStatsdClient(&statsd.NoOpClientDirect{})) defer tracer.Stop() assert := assert.New(t) ctx, err := tracer.Extract(tc.in) diff --git a/ddtrace/tracer/tracer_test.go b/ddtrace/tracer/tracer_test.go index 555c71080d..dd1820621e 100644 --- a/ddtrace/tracer/tracer_test.go +++ b/ddtrace/tracer/tracer_test.go @@ -2347,7 +2347,7 @@ func TestFlush(t *testing.T) { tr.statsd = ts transport := newDummyTransport() - c := newConcentrator(&config{transport: transport, env: "someEnv"}, defaultStatsBucketSize, &statsd.NoOpClient{}) + c := newConcentrator(&config{transport: transport, env: "someEnv"}, defaultStatsBucketSize, &statsd.NoOpClientDirect{}) tr.stats = c c.Start() defer c.Stop() diff --git a/go.mod b/go.mod index 6696dcc4cc..f3a841b96d 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/DataDog/datadog-agent/pkg/trace v0.58.0 github.com/DataDog/datadog-go/v5 v5.5.0 github.com/DataDog/go-libddwaf/v3 v3.5.1 - github.com/DataDog/go-runtime-metrics-internal v0.0.3 + github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20241206090539-a14610dc22b6 github.com/DataDog/gostackparse v0.7.0 github.com/DataDog/sketches-go v1.4.5 github.com/IBM/sarama v1.40.0 diff --git a/go.sum b/go.sum index b05429f344..6471b96ff5 100644 --- a/go.sum +++ b/go.sum @@ -644,8 +644,8 @@ github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/go-libddwaf/v3 v3.5.1 h1:GWA4ln4DlLxiXm+X7HA/oj0ZLcdCwOS81KQitegRTyY= github.com/DataDog/go-libddwaf/v3 v3.5.1/go.mod h1:n98d9nZ1gzenRSk53wz8l6d34ikxS+hs62A31Fqmyi4= -github.com/DataDog/go-runtime-metrics-internal v0.0.3 h1:AqzLCS4rqojBoCNwEAmbpLFAkKT43e+ze/a6aFbfDpU= -github.com/DataDog/go-runtime-metrics-internal v0.0.3/go.mod h1:quaQJ+wPN41xEC458FCpTwyROZm3MzmTZ8q8XOXQiPs= +github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20241206090539-a14610dc22b6 h1:bpitH5JbjBhfcTG+H2RkkiUXpYa8xSuIPnyNtTaSPog= +github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20241206090539-a14610dc22b6/go.mod h1:quaQJ+wPN41xEC458FCpTwyROZm3MzmTZ8q8XOXQiPs= github.com/DataDog/go-sqllexer v0.0.14 h1:xUQh2tLr/95LGxDzLmttLgTo/1gzFeOyuwrQa/Iig4Q= github.com/DataDog/go-sqllexer v0.0.14/go.mod h1:KwkYhpFEVIq+BfobkTC1vfqm4gTi65skV/DpDBXtexc= github.com/DataDog/go-tuf v1.1.0-0.5.2 h1:4CagiIekonLSfL8GMHRHcHudo1fQnxELS9g4tiAupQ4= diff --git a/internal/apps/go.mod b/internal/apps/go.mod index 9ce5485a85..d90e69002e 100644 --- a/internal/apps/go.mod +++ b/internal/apps/go.mod @@ -14,7 +14,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/log v0.58.0 // indirect github.com/DataDog/datadog-agent/pkg/util/scrubber v0.58.0 // indirect github.com/DataDog/go-libddwaf/v3 v3.5.1 // indirect - github.com/DataDog/go-runtime-metrics-internal v0.0.3 // indirect + github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20241206090539-a14610dc22b6 // indirect github.com/DataDog/go-sqllexer v0.0.14 // indirect github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.20.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect diff --git a/internal/apps/go.sum b/internal/apps/go.sum index a591990f7b..1ca195d002 100644 --- a/internal/apps/go.sum +++ b/internal/apps/go.sum @@ -16,8 +16,8 @@ github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/go-libddwaf/v3 v3.5.1 h1:GWA4ln4DlLxiXm+X7HA/oj0ZLcdCwOS81KQitegRTyY= github.com/DataDog/go-libddwaf/v3 v3.5.1/go.mod h1:n98d9nZ1gzenRSk53wz8l6d34ikxS+hs62A31Fqmyi4= -github.com/DataDog/go-runtime-metrics-internal v0.0.3 h1:AqzLCS4rqojBoCNwEAmbpLFAkKT43e+ze/a6aFbfDpU= -github.com/DataDog/go-runtime-metrics-internal v0.0.3/go.mod h1:quaQJ+wPN41xEC458FCpTwyROZm3MzmTZ8q8XOXQiPs= +github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20241206090539-a14610dc22b6 h1:bpitH5JbjBhfcTG+H2RkkiUXpYa8xSuIPnyNtTaSPog= +github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20241206090539-a14610dc22b6/go.mod h1:quaQJ+wPN41xEC458FCpTwyROZm3MzmTZ8q8XOXQiPs= github.com/DataDog/go-sqllexer v0.0.14 h1:xUQh2tLr/95LGxDzLmttLgTo/1gzFeOyuwrQa/Iig4Q= github.com/DataDog/go-sqllexer v0.0.14/go.mod h1:KwkYhpFEVIq+BfobkTC1vfqm4gTi65skV/DpDBXtexc= github.com/DataDog/go-tuf v1.1.0-0.5.2 h1:4CagiIekonLSfL8GMHRHcHudo1fQnxELS9g4tiAupQ4= diff --git a/internal/datastreams/processor_test.go b/internal/datastreams/processor_test.go index 1e0418a2d8..d60a01c4ef 100644 --- a/internal/datastreams/processor_test.go +++ b/internal/datastreams/processor_test.go @@ -264,7 +264,7 @@ func BenchmarkSetCheckpoint(b *testing.B) { client := &http.Client{ Transport: &noOpTransport{}, } - p := NewProcessor(&statsd.NoOpClient{}, "env", "service", "v1", &url.URL{Scheme: "http", Host: "agent-address"}, client) + p := NewProcessor(&statsd.NoOpClientDirect{}, "env", "service", "v1", &url.URL{Scheme: "http", Host: "agent-address"}, client) p.Start() for i := 0; i < b.N; i++ { p.SetCheckpointWithParams(context.Background(), options.CheckpointParams{PayloadSize: 1000}, "type:edge-1", "direction:in", "type:kafka", "topic:topic1", "group:group1") diff --git a/internal/exectracetest/go.mod b/internal/exectracetest/go.mod index 0bc1db3393..33a74a94ba 100644 --- a/internal/exectracetest/go.mod +++ b/internal/exectracetest/go.mod @@ -19,7 +19,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/scrubber v0.58.0 // indirect github.com/DataDog/datadog-go/v5 v5.5.0 // indirect github.com/DataDog/go-libddwaf/v3 v3.5.1 // indirect - github.com/DataDog/go-runtime-metrics-internal v0.0.3 // indirect + github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20241206090539-a14610dc22b6 // indirect github.com/DataDog/go-sqllexer v0.0.14 // indirect github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.20.0 // indirect diff --git a/internal/exectracetest/go.sum b/internal/exectracetest/go.sum index 0d8bd345c4..7321d5519b 100644 --- a/internal/exectracetest/go.sum +++ b/internal/exectracetest/go.sum @@ -16,8 +16,8 @@ github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/go-libddwaf/v3 v3.5.1 h1:GWA4ln4DlLxiXm+X7HA/oj0ZLcdCwOS81KQitegRTyY= github.com/DataDog/go-libddwaf/v3 v3.5.1/go.mod h1:n98d9nZ1gzenRSk53wz8l6d34ikxS+hs62A31Fqmyi4= -github.com/DataDog/go-runtime-metrics-internal v0.0.3 h1:AqzLCS4rqojBoCNwEAmbpLFAkKT43e+ze/a6aFbfDpU= -github.com/DataDog/go-runtime-metrics-internal v0.0.3/go.mod h1:quaQJ+wPN41xEC458FCpTwyROZm3MzmTZ8q8XOXQiPs= +github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20241206090539-a14610dc22b6 h1:bpitH5JbjBhfcTG+H2RkkiUXpYa8xSuIPnyNtTaSPog= +github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20241206090539-a14610dc22b6/go.mod h1:quaQJ+wPN41xEC458FCpTwyROZm3MzmTZ8q8XOXQiPs= github.com/DataDog/go-sqllexer v0.0.14 h1:xUQh2tLr/95LGxDzLmttLgTo/1gzFeOyuwrQa/Iig4Q= github.com/DataDog/go-sqllexer v0.0.14/go.mod h1:KwkYhpFEVIq+BfobkTC1vfqm4gTi65skV/DpDBXtexc= github.com/DataDog/go-tuf v1.1.0-0.5.2 h1:4CagiIekonLSfL8GMHRHcHudo1fQnxELS9g4tiAupQ4= diff --git a/internal/statsd.go b/internal/statsd.go index df1d18a307..60f3d4431c 100644 --- a/internal/statsd.go +++ b/internal/statsd.go @@ -19,6 +19,7 @@ type StatsdClient interface { CountWithTimestamp(name string, value int64, tags []string, rate float64, timestamp time.Time) error Gauge(name string, value float64, tags []string, rate float64) error GaugeWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time) error + DistributionSamples(name string, values []float64, tags []string, rate float64) error Timing(name string, value time.Duration, tags []string, rate float64) error Flush() error Close() error @@ -29,9 +30,9 @@ func NewStatsdClient(addr string, globalTags []string) (StatsdClient, error) { if addr == "" { addr = DefaultDogstatsdAddr } - client, err := statsd.New(addr, statsd.WithMaxMessagesPerPayload(40), statsd.WithTags(globalTags)) + client, err := statsd.NewDirect(addr, statsd.WithMaxMessagesPerPayload(40), statsd.WithTags(globalTags)) if err != nil { - return &statsd.NoOpClient{}, err + return &statsd.NoOpClientDirect{}, err } return client, nil } diff --git a/internal/statsdtest/statsdtest.go b/internal/statsdtest/statsdtest.go index 8845e6465c..ffcd700cd1 100644 --- a/internal/statsdtest/statsdtest.go +++ b/internal/statsdtest/statsdtest.go @@ -11,6 +11,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "gopkg.in/DataDog/dd-trace-go.v1/internal" ) type callType int64 @@ -24,6 +25,8 @@ const ( callTypeTiming ) +var _ internal.StatsdClient = &TestStatsdClient{} + type TestStatsdClient struct { mu sync.RWMutex gaugeCalls []TestStatsdCall @@ -104,6 +107,10 @@ func (tg *TestStatsdClient) CountWithTimestamp(name string, value int64, tags [] }) } +func (tg *TestStatsdClient) DistributionSamples(_ string, _ []float64, _ []string, _ float64) error { + panic("not implemented") +} + func (tg *TestStatsdClient) Timing(name string, value time.Duration, tags []string, rate float64) error { return tg.addMetric(callTypeTiming, tags, TestStatsdCall{ name: name,