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

contrib/twitchtv/twirp: Add explicit reference to the request span #726

Merged
merged 2 commits into from
Sep 22, 2020

Conversation

mickeyreiss
Copy link
Contributor

Refactor the twirp serverhooks, so that the specific span that was started in requestRoutedHook is finished in responseSentHook. This way, other server hooks that modify the context may start new spans in the context without conflicting with this middleware.

Fixes #725.

@mickeyreiss
Copy link
Contributor Author

This should be ready. I've marked it as a draft for now, until the problem and solution in #725 are confirmed.

contrib/twitchtv/twirp/twirp.go Outdated Show resolved Hide resolved
contrib/twitchtv/twirp/twirp.go Outdated Show resolved Hide resolved
@mickeyreiss mickeyreiss marked this pull request as ready for review September 17, 2020 01:15
@knusbaum knusbaum added this to the 1.28.0 milestone Sep 17, 2020
Copy link
Contributor

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comment above about the context keys.

Copy link
Contributor

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mickeyreiss The changes look great.

Would you mind adding a test for this?

@knusbaum knusbaum modified the milestones: 1.28.0, 1.27.0 Sep 22, 2020
Copy link
Contributor

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope you don't mind, I added a test directly on your branch.
Thanks for the contribution. This will go out in 1.27.0

@knusbaum knusbaum merged commit ec56425 into DataDog:v1 Sep 22, 2020
@mickeyreiss mickeyreiss deleted the fix-twirp-serverhooks branch September 22, 2020 18:14
@mickeyreiss
Copy link
Contributor Author

Perfect. Thanks for the help, @knusbaum!

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.

contrib/twitchtv/twirp: ServerHooks incompatible with twirp.ChainHooks
2 participants