tracer

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Traceback

func Traceback() string

Traceback returns a string showing the call path, used for debugging.

Types

type TracerProvider added in v0.0.4

type TracerProvider struct {
	Provider *tracesdk.TracerProvider
}

TracerProvider holds the state for a provider, and provides an easy way to shut it down without exposing the specific type of tracer returned.

func NewTracerProvider

func NewTracerProvider(ctx context.Context, otlpEndpoint string, traceToStdout bool, githash string, appname string, traceRatio float64) (*TracerProvider, error)

NewTracerProvider returns an OpenTelemetry TracerProvider configured to use the Jaeger exporter that will send spans to the provided url. The returned TracerProvider will also use a Resource configured with all the information about the application.

If no error is returned, `defer provider.Shutdown(ctx)` should be set up to ensure flushing occurs.

If the otlpEndpoint URL is empty, the OpenTelemetry TracerProvider will be configured to not report to an external tracer.

If traceToStdout is true, traces will be sent to stdout.

func (*TracerProvider) Shutdown added in v0.0.4

func (p *TracerProvider) Shutdown(ctx context.Context)

Shutdown should be deferred immediately after NewTracerProvider() when no error is returned. This will ensure that on app termination it will flush any buffered traces, if possible. A maximum time of 5 seconds will be allowed before we give up, to prevent a hang at shutdown.

Jump to

Keyboard shortcuts

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