diff --git a/input/elasticapm/internal/modeldecoder/v2/transaction_test.go b/input/elasticapm/internal/modeldecoder/v2/transaction_test.go index b2462f82..e1e4859a 100644 --- a/input/elasticapm/internal/modeldecoder/v2/transaction_test.go +++ b/input/elasticapm/internal/modeldecoder/v2/transaction_test.go @@ -643,12 +643,10 @@ func TestDecodeMapToTransactionModel(t *testing.T) { var input transaction var event modelpb.APMEvent modeldecodertest.SetStructValues(&input, modeldecodertest.DefaultValues()) - input.Type.Reset() attrs := map[string]interface{}{ "elastic.profiler_stack_trace_ids": []interface{}{"id1", "id2"}, } input.OTel.Attributes = attrs - input.OTel.SpanKind.Reset() mapToTransactionModel(&input, &event) assert.Equal(t, []string{"id1", "id2"}, event.Transaction.ProfilerStackTraceIds) diff --git a/input/otlp/traces.go b/input/otlp/traces.go index 0bd99c09..b9fe0339 100644 --- a/input/otlp/traces.go +++ b/input/otlp/traces.go @@ -278,7 +278,7 @@ func TranslateTransaction( switch kDots { case "elastic.profiler_stack_trace_ids": var vSlice = v.Slice() - event.Transaction.ProfilerStackTraceIds = make([]string, 0, vSlice.Len()) + event.Transaction.ProfilerStackTraceIds = slices.Grow(event.Transaction.ProfilerStackTraceIds, vSlice.Len()) for i := 0; i < vSlice.Len(); i++ { var idVal = vSlice.At(i) if idVal.Type() == pcommon.ValueTypeStr {