Documentation
¶
Overview ¶
Package pubsub provides functions to trace the cloud.google.com/pubsub/go package.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapReceiveHandler ¶
func WrapReceiveHandler(s *pubsub.Subscription, f func(context.Context, *pubsub.Message), opts ...ReceiveOption) func(context.Context, *pubsub.Message)
WrapReceiveHandler returns a receive handler that wraps the supplied handler, extracts any tracing metadata attached to the received message, and starts a receive span.
Types ¶
type PublishResult ¶
type PublishResult struct {
*pubsub.PublishResult
// contains filtered or unexported fields
}
PublishResult wraps *pubsub.PublishResult
func Publish ¶
func Publish(ctx context.Context, t *pubsub.Topic, msg *pubsub.Message) *PublishResult
Publish publishes a message on the specified topic and returns a PublishResult. This function is functionally equivalent to t.Publish(ctx, msg), but it also starts a publish span and it ensures that the tracing metadata is propagated as attributes attached to the published message. It is required to call (*PublishResult).Get(ctx) on the value returned by Publish to complete the span.
type ReceiveOption ¶ added in v1.28.0
type ReceiveOption func(cfg *config)
A ReceiveOption is used to customize spans started by WrapReceiveHandler.
func WithServiceName ¶ added in v1.28.0
func WithServiceName(serviceName string) ReceiveOption
WithServiceName sets the service name tag for traces started by WrapReceiveHandler.