diff --git a/exporter/datadogexporter/model.go b/exporter/datadogexporter/model.go index d0fc4525e3a4..0927b060697a 100644 --- a/exporter/datadogexporter/model.go +++ b/exporter/datadogexporter/model.go @@ -19,8 +19,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/trace/exportable/obfuscate" "github.com/DataDog/datadog-agent/pkg/trace/exportable/pb" "github.com/DataDog/datadog-agent/pkg/trace/exportable/sampler" - "github.com/DataDog/datadog-agent/pkg/trace/exportable/stats" - "github.com/DataDog/datadog-agent/pkg/trace/exportable/traceutil" ) // obfuscatePayload applies obfuscator rules to the trace payloads @@ -74,18 +72,3 @@ func getAnalyzedSpans(sps []*pb.Span) []*pb.Span { } return top } - -// Compute Sublayers updates a spans metrics with relevant metadata so that it's duration and breakdown between different services can -// be accurately displayed in the Datadog UI -func computeSublayerMetrics(calculator *sublayerCalculator, t pb.Trace) { - root := traceutil.GetRoot(t) - traceutil.ComputeTopLevel(t) - - subtraces := stats.ExtractSubtraces(t, root) - sublayers := make(map[*pb.Span][]stats.SublayerValue) - for _, subtrace := range subtraces { - subtraceSublayers := calculator.computeSublayers(subtrace.Trace) - sublayers[subtrace.Root] = subtraceSublayers - stats.SetSublayersOnSpan(subtrace.Root, subtraceSublayers) - } -} diff --git a/exporter/datadogexporter/stats.go b/exporter/datadogexporter/stats.go index 209838851430..d67cb2f5953e 100644 --- a/exporter/datadogexporter/stats.go +++ b/exporter/datadogexporter/stats.go @@ -27,13 +27,16 @@ const ( ) // ComputeAPMStats calculates the stats that should be submitted to APM about a given trace -func computeAPMStats(tracePayload *pb.TracePayload, calculator *sublayerCalculator, pushTime int64) *stats.Payload { +func computeAPMStats(tracePayload *pb.TracePayload, pushTime int64) *stats.Payload { statsRawBuckets := make(map[int64]*stats.RawBucket) + // removing sublayer calc as part of work to port + // https://github.com/DataDog/datadog-agent/pull/7450/files + var emptySublayer []stats.SublayerValue + bucketTS := pushTime - statsBucketDuration for _, trace := range tracePayload.Traces { spans := getAnalyzedSpans(trace.Spans) - sublayers := calculator.computeSublayers(trace.Spans) for _, span := range spans { // TODO: While this is hardcoded to assume a single 10s buckets for now, @@ -58,7 +61,7 @@ func computeAPMStats(tracePayload *pb.TracePayload, calculator *sublayerCalculat Weight: 1, TopLevel: true, } - statsRawBucket.HandleSpan(weightedSpan, tracePayload.Env, []string{versionAggregationTag}, sublayers) + statsRawBucket.HandleSpan(weightedSpan, tracePayload.Env, []string{versionAggregationTag}, emptySublayer) } } diff --git a/exporter/datadogexporter/traces_exporter.go b/exporter/datadogexporter/traces_exporter.go index 2e85bb0717cb..677ff8baf0df 100644 --- a/exporter/datadogexporter/traces_exporter.go +++ b/exporter/datadogexporter/traces_exporter.go @@ -16,13 +16,11 @@ package datadogexporter import ( "context" - "sync" "time" "github.com/DataDog/datadog-agent/pkg/trace/exportable/config/configdefs" "github.com/DataDog/datadog-agent/pkg/trace/exportable/obfuscate" "github.com/DataDog/datadog-agent/pkg/trace/exportable/pb" - "github.com/DataDog/datadog-agent/pkg/trace/exportable/stats" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer/pdata" "go.uber.org/zap" @@ -33,28 +31,12 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter/utils" ) -// sublayerCalculator is thread safe wrapper of a sublayer -// calculator. Each trace exporter has a single sublayer -// calculator that is reused by each push -type sublayerCalculator struct { - sc *stats.SublayerCalculator - mutex sync.Mutex -} - -// ComputeSublayers computes the sublayers of a trace -func (s *sublayerCalculator) computeSublayers(trace pb.Trace) []stats.SublayerValue { - s.mutex.Lock() - defer s.mutex.Unlock() - return s.sc.ComputeSublayers(trace) -} - type traceExporter struct { params component.ExporterCreateParams cfg *config.Config ctx context.Context edgeConnection TraceEdgeConnection obfuscator *obfuscate.Obfuscator - calculator *sublayerCalculator client *datadog.Client denylister *Denylister } @@ -89,14 +71,12 @@ func newTracesExporter(ctx context.Context, params component.ExporterCreateParam // a denylist for dropping ignored resources denylister := NewDenylister(cfg.Traces.IgnoreResources) - calculator := &sublayerCalculator{sc: stats.NewSublayerCalculator()} exporter := &traceExporter{ params: params, cfg: cfg, ctx: ctx, edgeConnection: createTraceEdgeConnection(cfg.Traces.TCPAddr.Endpoint, cfg.API.Key, params.BuildInfo), obfuscator: obfuscator, - calculator: calculator, client: client, denylister: denylister, } @@ -137,7 +117,7 @@ func (exp *traceExporter) pushTraceData( // we largely apply the same logic as the serverless implementation, simplified a bit // https://github.com/DataDog/datadog-serverless-functions/blob/f5c3aedfec5ba223b11b76a4239fcbf35ec7d045/aws/logs_monitoring/trace_forwarder/cmd/trace/main.go#L61-L83 fallbackHost := metadata.GetHost(exp.params.Logger, exp.cfg) - ddTraces, ms := convertToDatadogTd(td, fallbackHost, exp.calculator, exp.cfg, exp.denylister, exp.params.BuildInfo) + ddTraces, ms := convertToDatadogTd(td, fallbackHost, exp.cfg, exp.denylister, exp.params.BuildInfo) // group the traces by env to reduce the number of flushes aggregatedTraces := aggregateTracePayloadsByEnv(ddTraces) @@ -169,7 +149,7 @@ func (exp *traceExporter) pushWithRetry(ctx context.Context, ddTracePayload *pb. } // this is for generating metrics like hits, errors, and latency, it uses a separate endpoint than Traces - stats := computeAPMStats(ddTracePayload, exp.calculator, pushTime) + stats := computeAPMStats(ddTracePayload, pushTime) errStats := exp.edgeConnection.SendStats(context.Background(), stats, maxRetries) if errStats != nil { diff --git a/exporter/datadogexporter/translate_traces.go b/exporter/datadogexporter/translate_traces.go index 5f35dc34aa2c..e3fac377cb15 100644 --- a/exporter/datadogexporter/translate_traces.go +++ b/exporter/datadogexporter/translate_traces.go @@ -64,7 +64,7 @@ const ( ) // converts Traces into an array of datadog trace payloads grouped by env -func convertToDatadogTd(td pdata.Traces, fallbackHost string, calculator *sublayerCalculator, cfg *config.Config, blk *Denylister, buildInfo component.BuildInfo) ([]*pb.TracePayload, []datadog.Metric) { +func convertToDatadogTd(td pdata.Traces, fallbackHost string, cfg *config.Config, blk *Denylister, buildInfo component.BuildInfo) ([]*pb.TracePayload, []datadog.Metric) { // TODO: // do we apply other global tags, like version+service, to every span or only root spans of a service // should globalTags['service'] take precedence over a trace's resource.service.name? I don't believe so, need to confirm @@ -82,7 +82,7 @@ func convertToDatadogTd(td pdata.Traces, fallbackHost string, calculator *sublay host = fallbackHost } - payload := resourceSpansToDatadogSpans(rs, calculator, host, cfg, blk) + payload := resourceSpansToDatadogSpans(rs, host, cfg, blk) traces = append(traces, &payload) ms := metrics.DefaultMetrics("traces", host, uint64(pushTime), buildInfo) @@ -119,7 +119,7 @@ func aggregateTracePayloadsByEnv(tracePayloads []*pb.TracePayload) []*pb.TracePa } // converts a Trace's resource spans into a trace payload -func resourceSpansToDatadogSpans(rs pdata.ResourceSpans, calculator *sublayerCalculator, hostname string, cfg *config.Config, blk *Denylister) pb.TracePayload { +func resourceSpansToDatadogSpans(rs pdata.ResourceSpans, hostname string, cfg *config.Config, blk *Denylister) pb.TracePayload { // get env tag env := utils.NormalizeTag(cfg.Env) @@ -199,10 +199,6 @@ func resourceSpansToDatadogSpans(rs pdata.ResourceSpans, calculator *sublayerCal // TODO: allow users to configure specific spans to be marked as an analyzed spans for app analytics top := getAnalyzedSpans(apiTrace.Spans) - // calculates span metrics for representing direction and timing among it's different services for display in - // service overview graphs - // see: https://github.com/DataDog/datadog-agent/blob/f69a7d35330c563e9cad4c5b8865a357a87cd0dc/pkg/trace/stats/sublayers.go#L204 - computeSublayerMetrics(calculator, apiTrace.Spans) payload.Transactions = append(payload.Transactions, top...) payload.Traces = append(payload.Traces, apiTrace) } diff --git a/exporter/datadogexporter/translate_traces_test.go b/exporter/datadogexporter/translate_traces_test.go index 41eaab6c2721..28193b3ccd69 100644 --- a/exporter/datadogexporter/translate_traces_test.go +++ b/exporter/datadogexporter/translate_traces_test.go @@ -130,33 +130,29 @@ func NewResourceSpansData(mockTraceID [16]byte, mockSpanID [8]byte, mockParentSp return rs } -func newSublayerCalculator() *sublayerCalculator { - return &sublayerCalculator{sc: stats.NewSublayerCalculator()} -} - func TestConvertToDatadogTd(t *testing.T) { traces := pdata.NewTraces() traces.ResourceSpans().AppendEmpty() - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) buildInfo := component.BuildInfo{ Version: "1.0", } - outputTraces, runningMetrics := convertToDatadogTd(traces, "test-host", calculator, &config.Config{}, denylister, buildInfo) + outputTraces, runningMetrics := convertToDatadogTd(traces, "test-host", &config.Config{}, denylister, buildInfo) + assert.Equal(t, 1, len(outputTraces)) assert.Equal(t, 1, len(runningMetrics)) } func TestConvertToDatadogTdNoResourceSpans(t *testing.T) { traces := pdata.NewTraces() - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) buildInfo := component.BuildInfo{ Version: "1.0", } - outputTraces, runningMetrics := convertToDatadogTd(traces, "test-host", calculator, &config.Config{}, denylister, buildInfo) + outputTraces, runningMetrics := convertToDatadogTd(traces, "test-host", &config.Config{}, denylister, buildInfo) + assert.Equal(t, 0, len(outputTraces)) assert.Equal(t, 0, len(runningMetrics)) } @@ -184,7 +180,7 @@ func TestRunningTraces(t *testing.T) { Version: "1.0", } - _, runningMetrics := convertToDatadogTd(td, "fallbackHost", newSublayerCalculator(), &config.Config{}, NewDenylister([]string{}), buildInfo) + _, runningMetrics := convertToDatadogTd(td, "fallbackHost", &config.Config{}, NewDenylister([]string{}), buildInfo) runningHostnames := []string{} for _, metric := range runningMetrics { @@ -200,7 +196,6 @@ func TestRunningTraces(t *testing.T) { } func TestObfuscation(t *testing.T) { - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) buildInfo := component.BuildInfo{ Version: "1.0", @@ -223,7 +218,8 @@ func TestObfuscation(t *testing.T) { // of them is currently not supported. span.Attributes().InsertString("testinfo?=123", "http.route") - outputTraces, _ := convertToDatadogTd(traces, "test-host", calculator, &config.Config{}, denylister, buildInfo) + outputTraces, _ := convertToDatadogTd(traces, "test-host", &config.Config{}, denylister, buildInfo) + aggregatedTraces := aggregateTracePayloadsByEnv(outputTraces) obfuscator := obfuscate.NewObfuscator(obfuscatorConfig) @@ -235,7 +231,6 @@ func TestObfuscation(t *testing.T) { func TestBasicTracesTranslation(t *testing.T) { hostname := "testhostname" - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) // generate mock trace, span and parent span ids @@ -249,7 +244,7 @@ func TestBasicTracesTranslation(t *testing.T) { rs := NewResourceSpansData(mockTraceID, mockSpanID, mockParentSpanID, pdata.StatusCodeUnset, false, mockEndTime) // translate mocks to datadog traces - datadogPayload := resourceSpansToDatadogSpans(rs, calculator, hostname, &config.Config{}, denylister) + datadogPayload := resourceSpansToDatadogSpans(rs, hostname, &config.Config{}, denylister) // ensure we return the correct type assert.IsType(t, pb.TracePayload{}, datadogPayload) @@ -279,9 +274,9 @@ func TestBasicTracesTranslation(t *testing.T) { // ensure that span.type is based on otlp span.kind assert.Equal(t, "web", datadogPayload.Traces[0].Spans[0].Type) - // ensure that span.meta and span.metrics pick up attibutes, instrumentation ibrary and resource attribs + // ensure that span.meta and span.metrics pick up attributes, instrumentation ibrary and resource attribs assert.Equal(t, 10, len(datadogPayload.Traces[0].Spans[0].Meta)) - assert.Equal(t, 1, len(datadogPayload.Traces[0].Spans[0].Metrics)) + assert.Equal(t, 0, len(datadogPayload.Traces[0].Spans[0].Metrics)) // ensure that span error is based on otlp span status assert.Equal(t, int32(0), datadogPayload.Traces[0].Spans[0].Error) @@ -306,7 +301,6 @@ func TestBasicTracesTranslation(t *testing.T) { func TestBasicTracesDenylist(t *testing.T) { hostname := "testhostname" - calculator := newSublayerCalculator() // adding some regex bits to the resource name, but this should drop the trace denylister := NewDenylister([]string{".nd-To-E.d H.re"}) @@ -322,7 +316,7 @@ func TestBasicTracesDenylist(t *testing.T) { rs := NewResourceSpansData(mockTraceID, mockSpanID, mockParentSpanID, pdata.StatusCodeUnset, false, mockEndTime) // translate mocks to datadog traces - datadogPayload := resourceSpansToDatadogSpans(rs, calculator, hostname, &config.Config{}, denylister) + datadogPayload := resourceSpansToDatadogSpans(rs, hostname, &config.Config{}, denylister) // ensure we return the correct type assert.IsType(t, pb.TracePayload{}, datadogPayload) @@ -333,7 +327,6 @@ func TestBasicTracesDenylist(t *testing.T) { func TestTracesTranslationErrorsAndResource(t *testing.T) { hostname := "testhostname" - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) // generate mock trace, span and parent span ids @@ -354,7 +347,7 @@ func TestTracesTranslationErrorsAndResource(t *testing.T) { }, } - datadogPayload := resourceSpansToDatadogSpans(rs, calculator, hostname, &cfg, denylister) + datadogPayload := resourceSpansToDatadogSpans(rs, hostname, &cfg, denylister) // ensure we return the correct type assert.IsType(t, pb.TracePayload{}, datadogPayload) @@ -387,7 +380,6 @@ func TestTracesTranslationErrorsAndResource(t *testing.T) { // Ensures that if more than one error event occurs in a span, the last one is used for translation func TestTracesTranslationErrorsFromEventsUsesLast(t *testing.T) { hostname := "testhostname" - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) // generate mock trace, span and parent span ids @@ -436,7 +428,7 @@ func TestTracesTranslationErrorsFromEventsUsesLast(t *testing.T) { }, } - datadogPayload := resourceSpansToDatadogSpans(rs, calculator, hostname, &cfg, denylister) + datadogPayload := resourceSpansToDatadogSpans(rs, hostname, &cfg, denylister) // Ensure the error type is copied over from the last error event logged assert.Equal(t, attribs[conventions.AttributeExceptionType].StringVal(), datadogPayload.Traces[0].Spans[0].Meta[ext.ErrorType]) @@ -451,7 +443,6 @@ func TestTracesTranslationErrorsFromEventsUsesLast(t *testing.T) { // Ensures that if the first or last event in the list is the error, that translation still behaves properly func TestTracesTranslationErrorsFromEventsBounds(t *testing.T) { hostname := "testhostname" - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) // generate mock trace, span and parent span ids @@ -491,7 +482,7 @@ func TestTracesTranslationErrorsFromEventsBounds(t *testing.T) { }, } - datadogPayload := resourceSpansToDatadogSpans(rs, calculator, hostname, &cfg, denylister) + datadogPayload := resourceSpansToDatadogSpans(rs, hostname, &cfg, denylister) // Ensure the error type is copied over assert.Equal(t, attribs[conventions.AttributeExceptionType].StringVal(), datadogPayload.Traces[0].Spans[0].Meta[ext.ErrorType]) @@ -527,7 +518,6 @@ func TestTracesTranslationErrorsFromEventsBounds(t *testing.T) { func TestTracesTranslationOkStatus(t *testing.T) { hostname := "testhostname" - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) // generate mock trace, span and parent span ids @@ -548,7 +538,7 @@ func TestTracesTranslationOkStatus(t *testing.T) { }, } - datadogPayload := resourceSpansToDatadogSpans(rs, calculator, hostname, &cfg, denylister) + datadogPayload := resourceSpansToDatadogSpans(rs, hostname, &cfg, denylister) // ensure we return the correct type assert.IsType(t, pb.TracePayload{}, datadogPayload) @@ -577,7 +567,6 @@ func TestTracesTranslationOkStatus(t *testing.T) { // ensure that the datadog span uses the configured unified service tags func TestTracesTranslationConfig(t *testing.T) { hostname := "testhostname" - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) // generate mock trace, span and parent span ids @@ -599,7 +588,7 @@ func TestTracesTranslationConfig(t *testing.T) { } // translate mocks to datadog traces - datadogPayload := resourceSpansToDatadogSpans(rs, calculator, hostname, &cfg, denylister) + datadogPayload := resourceSpansToDatadogSpans(rs, hostname, &cfg, denylister) // ensure we return the correct type assert.IsType(t, pb.TracePayload{}, datadogPayload) @@ -625,7 +614,6 @@ func TestTracesTranslationConfig(t *testing.T) { // ensure that the translation returns early if no resource instrumentation library spans func TestTracesTranslationNoIls(t *testing.T) { hostname := "testhostname" - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) rs := pdata.NewResourceSpans() @@ -638,7 +626,7 @@ func TestTracesTranslationNoIls(t *testing.T) { } // translate mocks to datadog traces - datadogPayload := resourceSpansToDatadogSpans(rs, calculator, hostname, &cfg, denylister) + datadogPayload := resourceSpansToDatadogSpans(rs, hostname, &cfg, denylister) // ensure we return the correct type assert.IsType(t, pb.TracePayload{}, datadogPayload) @@ -650,7 +638,6 @@ func TestTracesTranslationNoIls(t *testing.T) { // ensure that the translation returns early if no resource instrumentation library spans func TestTracesTranslationInvalidService(t *testing.T) { hostname := "testhostname" - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) // generate mock trace, span and parent span ids @@ -689,9 +676,9 @@ func TestTracesTranslationInvalidService(t *testing.T) { } // translate mocks to datadog traces - datadogPayloadInvalidService := resourceSpansToDatadogSpans(rs, calculator, hostname, &cfgInvalidService, denylister) - datadogPayloadEmptyService := resourceSpansToDatadogSpans(rs, calculator, hostname, &cfgEmptyService, denylister) - datadogPayloadStartWithInvalidService := resourceSpansToDatadogSpans(rs, calculator, hostname, &cfgStartWithInvalidService, denylister) + datadogPayloadInvalidService := resourceSpansToDatadogSpans(rs, hostname, &cfgInvalidService, denylister) + datadogPayloadEmptyService := resourceSpansToDatadogSpans(rs, hostname, &cfgEmptyService, denylister) + datadogPayloadStartWithInvalidService := resourceSpansToDatadogSpans(rs, hostname, &cfgStartWithInvalidService, denylister) // ensure we return the correct type assert.IsType(t, pb.TracePayload{}, datadogPayloadInvalidService) @@ -709,7 +696,6 @@ func TestTracesTranslationInvalidService(t *testing.T) { // ensure that the datadog span uses the peer.name instead service.name when provided func TestTracesTranslationServicePeerName(t *testing.T) { hostname := "testhostname" - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) // generate mock trace, span and parent span ids @@ -726,7 +712,7 @@ func TestTracesTranslationServicePeerName(t *testing.T) { span.Attributes().InsertString(conventions.AttributePeerService, "my_peer_service_name") // translate mocks to datadog traces - datadogPayload := resourceSpansToDatadogSpans(rs, calculator, hostname, &config.Config{}, denylister) + datadogPayload := resourceSpansToDatadogSpans(rs, hostname, &config.Config{}, denylister) // ensure we return the correct type assert.IsType(t, pb.TracePayload{}, datadogPayload) @@ -756,9 +742,9 @@ func TestTracesTranslationServicePeerName(t *testing.T) { // ensure that span.type is based on otlp span.kind assert.Equal(t, "web", datadogPayload.Traces[0].Spans[0].Type) - // ensure that span.meta and span.metrics pick up attibutes, instrumentation ibrary and resource attribs + // ensure that span.meta and span.metrics pick up attributes, instrumentation ibrary and resource attribs assert.Equal(t, 11, len(datadogPayload.Traces[0].Spans[0].Meta)) - assert.Equal(t, 1, len(datadogPayload.Traces[0].Spans[0].Metrics)) + assert.Equal(t, 0, len(datadogPayload.Traces[0].Spans[0].Metrics)) // ensure that span error is based on otlp span status assert.Equal(t, int32(0), datadogPayload.Traces[0].Spans[0].Error) @@ -784,7 +770,6 @@ func TestTracesTranslationServicePeerName(t *testing.T) { // ensure that the datadog span uses the truncated tags if length exceeds max func TestTracesTranslationTruncatetag(t *testing.T) { hostname := "testhostname" - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) // generate mock trace, span and parent span ids @@ -802,7 +787,7 @@ func TestTracesTranslationTruncatetag(t *testing.T) { span.Attributes().InsertString(conventions.AttributeExceptionStacktrace, RandStringBytes(5500)) // translate mocks to datadog traces - datadogPayload := resourceSpansToDatadogSpans(rs, calculator, hostname, &config.Config{}, denylister) + datadogPayload := resourceSpansToDatadogSpans(rs, hostname, &config.Config{}, denylister) // ensure we return the correct type assert.IsType(t, pb.TracePayload{}, datadogPayload) @@ -832,9 +817,9 @@ func TestTracesTranslationTruncatetag(t *testing.T) { // ensure that span.type is based on otlp span.kind assert.Equal(t, "web", datadogPayload.Traces[0].Spans[0].Type) - // ensure that span.meta and span.metrics pick up attibutes, instrumentation ibrary and resource attribs + // ensure that span.meta and span.metrics pick up attributes, instrumentation ibrary and resource attribs assert.Equal(t, 11, len(datadogPayload.Traces[0].Spans[0].Meta)) - assert.Equal(t, 1, len(datadogPayload.Traces[0].Spans[0].Metrics)) + assert.Equal(t, 0, len(datadogPayload.Traces[0].Spans[0].Metrics)) // ensure that span error is based on otlp span status assert.Equal(t, int32(0), datadogPayload.Traces[0].Spans[0].Error) @@ -1181,7 +1166,6 @@ func TestTracePayloadAggr(t *testing.T) { // ensure that stats payloads get tagged with version tag func TestStatsAggregations(t *testing.T) { hostname := "testhostname" - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) // generate mock trace, span and parent span ids @@ -1198,9 +1182,9 @@ func TestStatsAggregations(t *testing.T) { // translate mocks to datadog traces cfg := config.Config{} - datadogPayload := resourceSpansToDatadogSpans(rs, calculator, hostname, &cfg, denylister) + datadogPayload := resourceSpansToDatadogSpans(rs, hostname, &cfg, denylister) - statsOutput := computeAPMStats(&datadogPayload, calculator, time.Now().UTC().UnixNano()) + statsOutput := computeAPMStats(&datadogPayload, time.Now().UTC().UnixNano()) var statsVersionTag stats.Tag @@ -1218,7 +1202,6 @@ func TestStatsAggregations(t *testing.T) { // ensure that sanitization of trace payloads occurs func TestSanitization(t *testing.T) { - calculator := newSublayerCalculator() denylister := NewDenylister([]string{}) buildInfo := component.BuildInfo{ Version: "1.0", @@ -1238,7 +1221,8 @@ func TestSanitization(t *testing.T) { instrumentationLibrary.SetVersion("v1") ilss.Spans().Resize(1) - outputTraces, _ := convertToDatadogTd(traces, "test-host", calculator, &config.Config{}, denylister, buildInfo) + outputTraces, _ := convertToDatadogTd(traces, "test-host", &config.Config{}, denylister, buildInfo) + aggregatedTraces := aggregateTracePayloadsByEnv(outputTraces) obfuscator := obfuscate.NewObfuscator(obfuscatorConfig)