trace

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNewTracer

func MustNewTracer(params Params) (otrace.Tracer, func(context.Context) error)

MustNewTracer creates a new Tracer. It produces the tracer it self and a flush function that should be used to deliver any trace residue in cases of system shutdown. It panics if any error is found during tracer construction. If your application is running outside of Google Cloud, make sure that your `GOOGLE_APPLICATION_CREDENTIALS` env variable is properly set.

func NewTracer

func NewTracer(params Params) (otrace.Tracer, func(context.Context) error, error)

NewTracer creates a new Tracer. It produces the tracer it self and a flush function that should be used to deliver any trace residue in cases of system shutdown. If your application is running outside of Google Cloud, make sure that your `GOOGLE_APPLICATION_CREDENTIALS` env variable is properly set.

Types

type Params

type Params struct {
	IsProductionEnvironment bool
	ApplicationName         string

	// ProjectID is an optional parameter, used for specifying which project the user is uploading the stats data to.
	// If ommited, this will default to your "Application Default Credentials".
	ProjectID string

	// TraceRatio indicates how often the system should collect traces.
	// Use it with caution: It may overload the system and also be too expensive to mantain its value too high in a
	// high throuput system. Values vary between 0 and 1, with 0 meaning No Sampling and 1 meaning Always Sampling.
	// Values lower than 0 are treated as 0 and values greater than 1 are treated as 1.
	TraceRatio float64
}

Params encodes necessary input data to initialize a new Tracer.

Jump to

Keyboard shortcuts

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