You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In my application, I am manually calling apm.Context.SetUsername to add user info to the transaction. When the transaction is set to the APM server, the username is wiped from the data in SetHTTPRequest. I've traced the problem to the following lines, which don't take into account when c.user.Username is already set: https://github.com/elastic/apm-agent-go/blob/master/context.go#L206-L213
It seems like this line: c.user.Username = truncateString(username) sets both c.user.Username and c.model.User.Username since they point to the same model.User object.
To Reproduce
In your http application, call tx.Context.SetUsername(username)
observe no username is present in the APM events
Expected behavior
Username should be set in the APM events.
The text was updated successfully, but these errors were encountered:
Describe the bug
In my application, I am manually calling
apm.Context.SetUsername
to add user info to the transaction. When the transaction is set to the APM server, theusername
is wiped from the data inSetHTTPRequest
. I've traced the problem to the following lines, which don't take into account whenc.user.Username
is already set:https://github.com/elastic/apm-agent-go/blob/master/context.go#L206-L213
It seems like this line:
c.user.Username = truncateString(username)
sets bothc.user.Username
andc.model.User.Username
since they point to the samemodel.User
object.To Reproduce
tx.Context.SetUsername(username)
Expected behavior
Username should be set in the APM events.
The text was updated successfully, but these errors were encountered: