Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/signalfx] Replace usages of Insert to Upsert on empty maps #13918

Merged
merged 1 commit into from
Sep 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions receiver/signalfxreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func (r *sfxReceiver) handleDatapointReq(resp http.ResponseWriter, req *http.Req
for i := 0; i < md.ResourceMetrics().Len(); i++ {
rm := md.ResourceMetrics().At(i)
res := rm.Resource()
res.Attributes().InsertString(splunk.SFxAccessTokenLabel, accessToken)
res.Attributes().UpsertString(splunk.SFxAccessTokenLabel, accessToken)
}
}
}
Expand Down Expand Up @@ -297,7 +297,7 @@ func (r *sfxReceiver) handleEventReq(resp http.ResponseWriter, req *http.Request

if r.config.AccessTokenPassthrough {
if accessToken := req.Header.Get(splunk.SFxAccessTokenHeader); accessToken != "" {
rl.Resource().Attributes().InsertString(splunk.SFxAccessTokenLabel, accessToken)
rl.Resource().Attributes().UpsertString(splunk.SFxAccessTokenLabel, accessToken)
}
}

Expand Down