Documentation ¶
Index ¶
- type CustomTracer
- func (c *CustomTracer) GetExporter() *otlptrace.Exporter
- func (c *CustomTracer) GetResource() *resource.Resource
- func (c *CustomTracer) GetTextMapPropagator() propagation.TextMapPropagator
- func (c *CustomTracer) GetTracerProvider() *trace.TracerProvider
- func (c *CustomTracer) InitExporter() (*otlptrace.Exporter, error)
- func (c *CustomTracer) InitResource() (*resource.Resource, error)
- func (c *CustomTracer) InitTracerProvider() (*trace.TracerProvider, error)
- func (t *CustomTracer) Shutdown()
- type Option
- func SetCollectorHost(collectorHost string) Option
- func SetIsInKubernetes(isInKubernetes bool) Option
- func SetLogger(logger *gologger.CustomLogger) Option
- func SetOtelExporter(exporter *otlptrace.Exporter) Option
- func SetPropagator(propagator propagation.TextMapPropagator) Option
- func SetResource(resource *resource.Resource) Option
- func SetSampler(sampler trace.Sampler) Option
- func SetServiceName(serviceName string) Option
- func SetTracingContext(ctx context.Context) Option
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 ¶
SetCollectorHost sets the collector host for the CustomTracer
func SetIsInKubernetes ¶
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 ¶
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 ¶
SetResource sets the resource for the CustomTracer
func SetSampler ¶
SetSampler sets the sampler for the CustomTracer
func SetServiceName ¶
SetServiceName sets the service name for the CustomTracer
func SetTracingContext ¶
SetTracingContext sets the tracing context for the CustomTracer