tracer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAxiomProvider

func NewAxiomProvider(ctx context.Context, otelService *observability.Service, dataset, apiKey string, options ...Option) (*trace.TracerProvider, func(ctx context.Context), error)

NewAxiomProvider creates a new OpenTelemetry tracer provider that sends traces to Axiom to the given dataset and authenticating with the given API key.

func NewAxiomProviderFromEnv

func NewAxiomProviderFromEnv(ctx context.Context, otelService *observability.Service, options ...Option) (*trace.TracerProvider, func(ctx context.Context), error)

NewAxiomProviderFromEnv creates a new OpenTelemetry tracer provider that sends traces to Axiom. It reads the following environment variables:

  • AXIOM_API_KEY: The Axiom API key.
  • AXIOM_TRACES_DATASET: The dataset where traces should be stored.

func NewOtelProvider

func NewOtelProvider(ctx context.Context, otelService *observability.Service, options ...Option) (*trace.TracerProvider, func(ctx context.Context), error)

NewOtelProvider creates a new OpenTelemetry tracer provider.

func NewOtelProviderWithProcessors

func NewOtelProviderWithProcessors(otelService *observability.Service, processors ...trace.SpanProcessor) *trace.TracerProvider

NewOtelProviderWithProcessors creates a new OpenTelemetry tracer provider with the given processors.

func NewOtelSpanProcessor

func NewOtelSpanProcessor(ctx context.Context, options ...Option) (trace.SpanProcessor, error)

NewOtelSpanProcessor creates a new OpenTelemetry HTTP span processor.

Types

type Option

type Option func(*Options)

func WithEndpointURL

func WithEndpointURL(endpoint string) Option

WithEndpointURL sets the target endpoint URL (scheme, host, port, path) the Exporter will connect to.

func WithExportInterval

func WithExportInterval(exportInterval time.Duration) Option

WithExportInterval sets the maximum duration between batched exports. If set to 0, traces will not be batched.

Defaults to 5s.

func WithHeaders

func WithHeaders(headers map[string]string) Option

WithHeaders sets headers to send on each HTTP request.

type Options

type Options struct {
	Endpoint       string
	Headers        map[string]string
	ExportInterval time.Duration
}

Options contain the configuration for tracing.

Jump to

Keyboard shortcuts

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