tracer

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package tracer provides a global OpenTelemetry tracer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(opts ...func(*options)) (func(context.Context) error, error)

Init initialises the global tracer via the option(s) defaulting to a noop tracer. It returns a shutdown function.

func RootedCtx added in v0.2.0

func RootedCtx(ctx context.Context, traceID trace.TraceID) context.Context

RootedCtx returns a copy of the parent context containing a tracing span context rooted to the trace ID. All spans started from the context will be rooted to the trace ID.

func Start

func Start(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, trace.Span)

Start creates a span and a context.Context containing the newly-created span from the global tracer. See go.opentelemetry.io/otel/trace#Start for more details.

func WithJaeger

func WithJaeger(addr string) func(*options)

WithJaeger returns an option to configure an OpenTelemetry tracing exporter for Jaeger.

func WithJaegerOrNoop

func WithJaegerOrNoop(jaegerAddr string) func(*options)

WithJaegerOrNoop returns an option to configure an OpenTelemetry tracing exporter for Jaeger if the address is not empty, else the default noop tracer is retained.

func WithJaegerService added in v0.2.0

func WithJaegerService(service string) func(*options)

WithJaegerService returns an option to configure the jaeger service name.

func WithStdOut

func WithStdOut(w io.Writer) func(*options)

WithStdOut returns an option to configure an OpenTelemetry exporter for tracing telemetry to be written to an output destination as JSON.

Types

This section is empty.

Jump to

Keyboard shortcuts

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