oteltrace

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 20 Imported by: 14

Documentation

Overview

Package oteltrace provides helpers for otel tracing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNoopTracer added in v0.1.8

func NewNoopTracer() trace.Tracer

NewNoopTracer creates a No-Op Tracer.

func TraceStart

func TraceStart(options TraceOptions) (trace.Tracer, func(), error)

TraceStart initializes tracing.

These env vars become available for customization at runtime:

# Example for Jaeger
export OTELCONFIG_EXPORTER=jaeger
export OTEL_TRACES_EXPORTER=jaeger
export OTEL_PROPAGATORS=b3multi
export OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger-collector:14268

# Example for gRPC and OTLP
export OTELCONFIG_EXPORTER=grpc
export OTEL_TRACES_EXPORTER=otlp
export OTEL_PROPAGATORS=b3multi
export OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger-collector:4317

# Example for HTTP and OTLP
export OTELCONFIG_EXPORTER=http
export OTEL_TRACES_EXPORTER=otlp
export OTEL_PROPAGATORS=b3multi
export OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger-collector:4318

Types

type TraceOptions added in v0.1.0

type TraceOptions struct {
	DefaultService     string
	NoopTracerProvider bool // Disable tracer
	NoopPropagator     bool // Disable propagator
	Debug              bool
}

TraceOptions provides options for TraceStart.

Jump to

Keyboard shortcuts

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