opentelemetry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportEnvironment

func ExportEnvironment(config *config.Config)

ExportEnvironment gives the OTLP endpoint of the configuration to the OpenTelemetry SDK, which reads it from OTEL_EXPORTER_OTLP_ENDPOINT. It changes the environment of the process, so it belongs to the startup wiring (main): call it once, before Init.

Types

type OtelService

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

func NewOtelService

func NewOtelService() OtelService

func (*OtelService) Init

func (s *OtelService) Init(ctx context.Context, config *config.Config) error

Init creates the OpenTelemetry tracer provider of the service. It does not change any process-wide state: Install does, and is called by the startup wiring only.

func (*OtelService) Install

func (s *OtelService) Install(zapLog *zap.Logger)

Install makes the tracer provider of the service (or a no-op one when Init found OpenTelemetry disabled) the global OpenTelemetry provider, with the error handler and the propagator of the relay proxy. The OpenTelemetry API only offers process-wide registration, so it is the startup wiring (main) that asks for it.

func (*OtelService) Stop

func (s *OtelService) Stop(ctx context.Context) error

Stop the OpenTelemetry service.

Jump to

Keyboard shortcuts

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