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

ddtrace: support tracer.SetUser on a mockspan #1480

Merged
merged 2 commits into from Sep 28, 2022

Conversation

Julio-Guerra
Copy link
Contributor

tracer.SetUser() was specific to the tracer.span type and therefore not working with the mockup span type.

To be able to use tracer.SetUser() on the mockup span type, this PR proposes to implement its behavior through the exported SetUser() method of the span struct types so we can implement it once for any span type implementing this method.

Fixes #1451

tracer.SetUser() was specific to the *tracer.span type and therefore was not working
with the mockup span.
To be able to use tracer.SetUser() on the mockup span type, we propose to implement
its behaviour through the now exported `SetUser()` method of the span struct types.
tracer.SetUser() does a type-assertion to check this method is present and delegates
its call to it. We can now provide a proper implementation for *mockspan.
@Julio-Guerra Julio-Guerra marked this pull request as ready for review September 22, 2022 21:55
@Julio-Guerra Julio-Guerra requested a review from a team September 22, 2022 21:55
@ajgajg1134 ajgajg1134 added this to the 1.43.0 milestone Sep 28, 2022
@ajgajg1134 ajgajg1134 merged commit 8fdd9c8 into main Sep 28, 2022
@ajgajg1134 ajgajg1134 deleted the julio.guerra/tracer-set-user-interface branch September 28, 2022 19:46
Hellzy pushed a commit that referenced this pull request Sep 30, 2022
tracer.SetUser() was specific to the *tracer.span type and therefore was not working
with the mockup span.
To be able to use tracer.SetUser() on the mockup span type, we propose to implement
its behaviour through the now exported `SetUser()` method of the span struct types.
tracer.SetUser() does a type-assertion to check this method is present and delegates
its call to it. We can now provide a proper implementation for *mockspan.

Co-authored-by: Andrew Glaude <andrew.glaude@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mocktracer: v1.41.0 breaks mocktracer and user attribute information
2 participants