Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Carson Ip <[email protected]>
  • Loading branch information
JonasKunz and carsonip authored Feb 7, 2024
1 parent 05c1dc9 commit 5c4b7aa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions input/elasticapm/internal/modeldecoder/v2/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion input/otlp/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Check failure on line 281 in input/otlp/traces.go

View workflow job for this annotation

GitHub Actions / run-tests

undefined: slices
for i := 0; i < vSlice.Len(); i++ {
var idVal = vSlice.At(i)
if idVal.Type() == pcommon.ValueTypeStr {
Expand Down

0 comments on commit 5c4b7aa

Please sign in to comment.