-
Notifications
You must be signed in to change notification settings - Fork 435
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/cloud.google.com/go/pubsub.v1: Add WithServiceName option #757
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this.
@gbbr Thanks for the review. Please take another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, left a few more things!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is looking good to me now. If you wish, you can change Option
to ReceiveOption
. That is a good point you made.
be94264
to
021ae26
Compare
@gbbr I addressed your comments and rebased against the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent. Thanks!
Contrib test failures are unrelated to this patch. They were fixed in #761 |
Is this blocked? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @mickeyreiss.
This is not blocked, I just haven't upmerged it yet to get the contrib tests to pass, so it has not been merged.
It is still approved and marked to go in as part of the 1.28.0
release.
If you would like to upmerge feel free, otherwise I will do so sometime before the 1.28.0
release.
021ae26
to
d6223c8
Compare
This adds a new options parameter, as well as a new option for
WrapReceiveHandler
, so that GCP pubsub receivers can set a custom service name for their traces.This PR also introduces an options pattern for this library, so that other options can be added in the future.
For the unit test, I was somewhat lazy, in that I simply copied the existing test and modified it to utilize the new option.
This solution will work for my use-case, but it won't be sufficient in case the pubsub receiver is started in the context of another trace. I don't think it is common to set up new receivers dynamically, but I did want to call that out as a limitation to this solution.
Feel free to leave code review notes or make commits to this branch directly. Thanks!
Fixes #752.
cc/ #721 @CAFxX @knusbaum @gbbr