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

Missing AddUser method for Segment #355

Open
pm98zz-c opened this issue Apr 7, 2022 · 1 comment
Open

Missing AddUser method for Segment #355

pm98zz-c opened this issue Apr 7, 2022 · 1 comment

Comments

@pm98zz-c
Copy link
Contributor

pm98zz-c commented Apr 7, 2022

According to https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go-segment.html#xray-sdk-go-segment-userid one should be able to add an userID to the trace.
The doc states to use "segment.AddUser()", which does not seem to exist. The example just below simply directly set the segment.User string (which I suspect would actually need to be wrapped in a mutex lock).

Am I missing something obvious? Happy to submit a PR for the AddUser method, should be straightforward, but I prefer to check it's just not me overlooking something.

Additionally, the doc for annotations and metadata is also slightly wrong, in that it misses the first context argument (for context.AddMetadata and AddAnnotation).

@bhautikpip
Copy link
Contributor

bhautikpip commented Apr 18, 2022

Yeah I couldn't find the segment.AddUser() API in the doc. Can you send me the link? Also, I think right now SDK still lets you set the User by retrieving the current segment from context. Are you suggesting to add a method to the SDK which sets the user and also should be thread-safe? If yes, I think it would be a good idea and happy to review PR! Can you also clarify which method are you pointing from SDK which is not align with documentation? Is it AddAnnotation method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants