Documentation ¶
Index ¶
- func ContextWithTracer(ctx context.Context, tracer trace.Tracer) context.Context
- func HandleSpanError(span *trace.Span, message string, err error)
- func NewTracerFromContext(ctx context.Context) trace.Tracer
- func SetSpanAttributesFromStruct(span *trace.Span, key string, valueStruct any) error
- type Telemetry
- func (tl *Telemetry) InitializeTelemetry() *Telemetry
- func (tl *Telemetry) NewLoggerExporter(ctx context.Context) (*otlploggrpc.Exporter, error)
- func (tl *Telemetry) NewLoggerProvider(rsc *sdkresource.Resource, exp *otlploggrpc.Exporter) *sdklog.LoggerProvider
- func (tl *Telemetry) NewResource() (*sdkresource.Resource, error)
- func (tl *Telemetry) ShutdownTelemetry()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithTracer ¶
ContextWithTracer returns a context within a trace.Tracer in "tracer" value.
func NewTracerFromContext ¶
NewTracerFromContext returns a new tracer from the context.
Types ¶
type Telemetry ¶
type Telemetry struct { LibraryName string ServiceName string ServiceVersion string DeploymentEnv string CollectorExporterEndpoint string TracerProvider *sdktrace.TracerProvider MetricProvider *sdkmetric.MeterProvider Logger mlog.Logger // contains filtered or unexported fields }
func (*Telemetry) InitializeTelemetry ¶
InitializeTelemetry initializes the telemetry providers and sets them globally.
func (*Telemetry) NewLoggerExporter ¶
NewLoggerExporter creates a new logger exporter that writes to stdout.
func (*Telemetry) NewLoggerProvider ¶
func (tl *Telemetry) NewLoggerProvider(rsc *sdkresource.Resource, exp *otlploggrpc.Exporter) *sdklog.LoggerProvider
NewLoggerProvider creates a new logger provider with stdout exporter and default resource.
func (*Telemetry) NewResource ¶
func (tl *Telemetry) NewResource() (*sdkresource.Resource, error)
NewResource creates a new resource with default attributes.
func (*Telemetry) ShutdownTelemetry ¶
func (tl *Telemetry) ShutdownTelemetry()
Click to show internal directories.
Click to hide internal directories.