tracing

package
v1.69.1-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package tracing contains tracing logic for the cloud.google.com/go/pubsub.v1 instrumentation.

WARNING: this package SHOULD NOT import cloud.google.com/go/pubsub.

The motivation of this package is to support orchestrion, which cannot use the main package because it imports the cloud.google.com/go/pubsub package, and since orchestrion modifies the library code itself, this would cause an import cycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TracePublish

func TracePublish(ctx context.Context, topic Topic, msg *Message, opts ...Option) (context.Context, func(serverID string, err error))

func TraceReceiveFunc

func TraceReceiveFunc(s Subscription, opts ...Option) func(ctx context.Context, msg *Message) (context.Context, func())

Types

type Message

type Message struct {
	ID              string
	Data            []byte
	OrderingKey     string
	Attributes      map[string]string
	DeliveryAttempt *int
	PublishTime     time.Time
}

type Option

type Option func(cfg *config)

Option is used to customize spans started by WrapReceiveHandler or Publish.

func WithMeasured

func WithMeasured() Option

WithMeasured sets the measured tag for traces started by WrapReceiveHandler or Publish.

func WithServiceName

func WithServiceName(serviceName string) Option

WithServiceName sets the service name tag for traces started by WrapReceiveHandler or Publish.

type Subscription

type Subscription interface {
	String() string
}

type Topic

type Topic interface {
	String() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL