telemetry

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOpenTelemetryNotEnabled = errors.New("OTEL_ENABLED is not set to true")
)

Functions

func GetServiceName

func GetServiceName() string

GetServiceName combines the values of the environment variables OTEL_SERVICE_NAME_PREFIX and OTEL_SERVICE_NAME with fallback to "m8" and "version.Name"

func GetSpan

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

GetSpan creates a span and a context.Context containing the newly-created span with default attributes set.

func GetTracer

func GetTracer() trace.Tracer

GetTracer returns a new traces with the current service name set

func InitOpenTelemetry

func InitOpenTelemetry(ctx context.Context) (func() error, error)

InitOpenTelemetry configures and sets the global MeterProvider and TracerProvider for OpenTelemetry

Types

This section is empty.

Jump to

Keyboard shortcuts

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