Documentation ¶
Overview ¶
Package state provides the functionality to "pack" into a single structure a set of configured instances (exporters, meters, tracers...)
Index ¶
- func SetGlobalState(s *OTELState)
- type GetterFn
- type OTEL
- type OTELState
- func (s *OTELState) Meter() metric.Meter
- func (s *OTELState) MeterProvider() metric.MeterProvider
- func (s *OTELState) Propagator() propagation.TextMapPropagator
- func (s *OTELState) Shutdown(ctx context.Context)
- func (s *OTELState) Tracer() trace.Tracer
- func (s *OTELState) TracerProvider() trace.TracerProvider
- type OTELStateConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetGlobalState ¶
func SetGlobalState(s *OTELState)
SetGlobalState set the provided state as the global state.
Types ¶
type GetterFn ¶
type GetterFn func() OTEL
GetterFn defines a function that will return an OTEL instance.
type OTEL ¶
type OTEL interface { Tracer() trace.Tracer Meter() metric.Meter Propagator() propagation.TextMapPropagator Shutdown(ctx context.Context) MeterProvider() metric.MeterProvider TracerProvider() trace.TracerProvider }
OTEL defines the interface to obtain observability instruments for a state.
type OTELState ¶
type OTELState struct {
// contains filtered or unexported fields
}
OTELState is the basic implementation of an OTEL intstance.
func NewWithVersion ¶
func NewWithVersion(serviceName string, cfg *OTELStateConfig, version string, me map[string]exporter.MetricReader, te map[string]exporter.SpanExporter, ) (*OTELState, error)
NewWithVersion create a new OTELState with a version for the KrakenD service, with the provided metrics and traces exporters
func (*OTELState) MeterProvider ¶
func (s *OTELState) MeterProvider() metric.MeterProvider
func (*OTELState) Propagator ¶
func (s *OTELState) Propagator() propagation.TextMapPropagator
Propagator returns the configured propagator to use.
func (*OTELState) Shutdown ¶
Shutdown performs the clean shutdown to be able to flush pending traces and / or metrics.
func (*OTELState) TracerProvider ¶
func (s *OTELState) TracerProvider() trace.TracerProvider