You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
knusbaum
changed the title
contrib/cloud.google.com/go/pubsub should support custom service names
proposal: contrib/cloud.google.com/go/pubsub should support custom service names
Oct 5, 2020
Enabling users to specify things like the service name is ideal.
I think 'WrapReceiveHandler` could just take a variadic list of StartSpanOption, and we can add those to a list of the existing options.
We do want to maintain backwards-compatibility, so we should give this function a new name, and have WrapReceiveHandler call the new function with no additional arguments.
Scratch that. A variadic function shouldn't require a rename since zero option arguments is valid. 😄
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.
Fixes#752
It is useful to be able to configure span options, such as a default service name, but
pubsubtrace.WrapReceiveHandler
does not allow this override.In particular, this signature:
doesn't allow one to set the service name.
Maybe it should be something like this:
Here's sql trace, for comparison, which does allow overrides via the third parameter on:
The text was updated successfully, but these errors were encountered: