Skip to content

Commit

Permalink
[chore]: replace Insert with Upsert in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu committed Sep 6, 2022
1 parent 676a326 commit b6390d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions processor/routingprocessor/extract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ func TestExtractorForTraces_FromResourceAttribute(t *testing.T) {
tracesFunc: func() ptrace.Traces {
traces := ptrace.NewTraces()
rSpans := traces.ResourceSpans().AppendEmpty()
rSpans.Resource().Attributes().
InsertString("k8s.namespace.name", "namespace-1")
rSpans.Resource().Attributes().UpsertString("k8s.namespace.name", "namespace-1")
return traces
},
fromAttr: "k8s.namespace.name",
Expand All @@ -105,8 +104,7 @@ func TestExtractorForTraces_FromResourceAttribute(t *testing.T) {
tracesFunc: func() ptrace.Traces {
traces := ptrace.NewTraces()
rSpans := traces.ResourceSpans().AppendEmpty()
rSpans.Resource().Attributes().
InsertString("k8s.namespace.name", "namespace-1")
rSpans.Resource().Attributes().UpsertString("k8s.namespace.name", "namespace-1")
return traces
},
fromAttr: "k8s.namespace.name",
Expand Down
2 changes: 1 addition & 1 deletion processor/servicegraphprocessor/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func sampleTraces() ptrace.Traces {
clientSpan.SetKind(ptrace.SpanKindClient)
clientSpan.SetStartTimestamp(pcommon.NewTimestampFromTime(tStart))
clientSpan.SetEndTimestamp(pcommon.NewTimestampFromTime(tEnd))
clientSpan.Attributes().Insert("some-attribute", pcommon.NewValueString("val")) // Attribute selected as dimension for metrics
clientSpan.Attributes().UpsertString("some-attribute", "val") // Attribute selected as dimension for metrics

serverSpan := scopeSpans.Spans().AppendEmpty()
serverSpan.SetName("server span")
Expand Down

0 comments on commit b6390d1

Please sign in to comment.