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/cloud.google.com/go/pubsub.v1: Add WithServiceName option #757

Merged
merged 1 commit into from
Dec 1, 2020

Conversation

mickeyreiss
Copy link
Contributor

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

Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Thanks for this.

contrib/cloud.google.com/go/pubsub.v1/pubsub.go Outdated Show resolved Hide resolved
@mickeyreiss
Copy link
Contributor Author

@gbbr Thanks for the review. Please take another look.

Copy link
Contributor

@gbbr gbbr left a 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!

contrib/cloud.google.com/go/pubsub.v1/pubsub.go Outdated Show resolved Hide resolved
contrib/cloud.google.com/go/pubsub.v1/pubsub.go Outdated Show resolved Hide resolved
contrib/cloud.google.com/go/pubsub.v1/pubsub.go Outdated Show resolved Hide resolved
contrib/cloud.google.com/go/pubsub.v1/pubsub.go Outdated Show resolved Hide resolved
contrib/cloud.google.com/go/pubsub.v1/pubsub.go Outdated Show resolved Hide resolved
@mickeyreiss mickeyreiss requested a review from gbbr October 8, 2020 00:34
@gbbr gbbr added this to the 1.28.0 milestone Oct 8, 2020
Copy link
Contributor

@gbbr gbbr left a 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.

contrib/cloud.google.com/go/pubsub.v1/pubsub.go Outdated Show resolved Hide resolved
@mickeyreiss
Copy link
Contributor Author

@gbbr I addressed your comments and rebased against the v1 branch.

gbbr
gbbr previously approved these changes Oct 9, 2020
Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Excellent. Thanks!

@knusbaum
Copy link
Contributor

Contrib test failures are unrelated to this patch. They were fixed in #761

@mickeyreiss
Copy link
Contributor Author

Is this blocked?

knusbaum
knusbaum previously approved these changes Nov 23, 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.

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.

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.

proposal: contrib/cloud.google.com/go/pubsub should support custom service names
3 participants