cloudtrace

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package cloudtrace provides common functions for attaching values to trace spans

Index

Constants

This section is empty.

Variables

View Source
var ErrNilConfig = errors.New("nil cloudtrace tracer config")

ErrNilConfig indicates SetupCloudTrace was called with no config. It is a named error rather than the nil pointer read that used to happen at cfg.ProjectID, which is what a deployment naming "cloudtrace" and supplying no cloudtrace block got.

Functions

func SetupCloudTrace

func SetupCloudTrace(ctx context.Context, serviceName string, spanCollectionProbability float64, cfg *Config) (tracing.Provider, error)

SetupCloudTrace creates a new trace provider instance and registers it as global trace provider.

Types

type Config

type Config struct {
	ProjectID string `env:"GOOGLE_CLOUD_TRACE_PROJECT_ID" json:"projectID,omitempty" yaml:"projectID,omitempty"`
	// contains filtered or unexported fields
}

Config contains settings related to tracing.

func (*Config) ValidateWithContext

func (c *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates the config struct.

Jump to

Keyboard shortcuts

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