gotracer

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomTracer

type CustomTracer struct {
	// contains filtered or unexported fields
}

CustomTracer struct holds the configuration and state for the tracing setup

func NewCustomTracer

func NewCustomTracer(traceOptions ...Option) *CustomTracer

NewCustomTracer is the constructor for the CustomTracer struct It takes in a list of options to set various configuration options for the CustomTracer By default it sets a combination of parent based and trace id based sampler with 1% sampling rate

func (*CustomTracer) GetExporter

func (c *CustomTracer) GetExporter() *otlptrace.Exporter

GetExporter returns the exporter for the CustomTracer

func (*CustomTracer) GetResource

func (c *CustomTracer) GetResource() *resource.Resource

GetResource returns the resource for the CustomTracer

func (*CustomTracer) GetTextMapPropagator

func (c *CustomTracer) GetTextMapPropagator() propagation.TextMapPropagator

GetTextMapPropagator returns the propagator for the CustomTracer

func (*CustomTracer) GetTracerProvider

func (c *CustomTracer) GetTracerProvider() *trace.TracerProvider

GetTracerProvider returns the tracer provider for the CustomTracer

func (*CustomTracer) InitExporter

func (c *CustomTracer) InitExporter() (*otlptrace.Exporter, error)

InitExporter initializes the OpenTelemetry exporter for tracing

func (*CustomTracer) InitResource

func (c *CustomTracer) InitResource() (*resource.Resource, error)

InitResource initializes the OpenTelemetry resource for tracing

func (*CustomTracer) InitTracerProvider

func (c *CustomTracer) InitTracerProvider() (*trace.TracerProvider, error)

InitTracerProvider initializes the OpenTelemetry tracer provider

func (*CustomTracer) Shutdown

func (t *CustomTracer) Shutdown()

Shutdown shuts down the tracer provider and exporter

type Option

type Option func(t *CustomTracer)

Option is a function type used to set various options for the CustomTracer

func SetCollectorHost

func SetCollectorHost(collectorHost string) Option

SetCollectorHost sets the collector host for the CustomTracer

func SetIsInKubernetes

func SetIsInKubernetes(isInKubernetes bool) Option

SetIsInKubernetes sets the Kubernetes environment flag for the CustomTracer

func SetLogger

func SetLogger(logger *gologger.CustomLogger) Option

SetLogger sets the logger for the CustomTracer

func SetOtelExporter

func SetOtelExporter(exporter *otlptrace.Exporter) Option

SetOtelExporter sets the OpenTelemetry exporter for the CustomTracer

func SetPropagator

func SetPropagator(propagator propagation.TextMapPropagator) Option

SetPropagator sets the propagator for the CustomTracer

func SetResource

func SetResource(resource *resource.Resource) Option

SetResource sets the resource for the CustomTracer

func SetSampler

func SetSampler(sampler trace.Sampler) Option

SetSampler sets the sampler for the CustomTracer

func SetServiceName

func SetServiceName(serviceName string) Option

SetServiceName sets the service name for the CustomTracer

func SetTracingContext

func SetTracingContext(ctx context.Context) Option

SetTracingContext sets the tracing context for the CustomTracer

Jump to

Keyboard shortcuts

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