Documentation ¶
Index ¶
- Constants
- Variables
- func Version() string
- type Closer
- type Config
- type ContextKey
- type LogConfig
- type Logger
- type LoggerConfig
- type LoggerControl
- type LoggerOption
- type LoggerProvider
- type Meter
- type MeterConfig
- type MeterControl
- type MeterOption
- type MeterProvider
- type MetricConfig
- type NoopLog
- func (m *NoopLog) Debug(_ context.Context, _ string, _ ...slog.Attr)
- func (m *NoopLog) Error(_ context.Context, _ string, _ ...slog.Attr)
- func (m *NoopLog) Info(_ context.Context, _ string, _ ...slog.Attr)
- func (m *NoopLog) NewLogger(options ...LoggerOption) Logger
- func (m *NoopLog) Panic(_ context.Context, _ string, _ ...slog.Attr)
- func (m *NoopLog) Shutdown(_ context.Context) error
- func (m *NoopLog) Warn(_ context.Context, _ string, _ ...slog.Attr)
- type NoopMetric
- type NoopPropagate
- type NoopProvide
- func (m *NoopProvide) CollectorEndpoint() string
- func (m *NoopProvide) NewLogControl(cfg LogConfig) (LoggerControl, error)
- func (m *NoopProvide) NewMetricControl(cfg MetricConfig) (MeterControl, error)
- func (m *NoopProvide) NewPropagateControl(cfg PropagateConfig) (PropagatorControl, error)
- func (m *NoopProvide) NewTraceControl(cfg TraceConfig) (TracerControl, error)
- type NoopTrace
- type Option
- type PropagateConfig
- type Propagator
- type PropagatorControl
- type Provider
- type ProviderConfig
- type Telemetry
- func (m *Telemetry) Debug(ctx context.Context, msg string, attrs ...slog.Attr)
- func (m *Telemetry) Error(ctx context.Context, msg string, attrs ...slog.Attr)
- func (m *Telemetry) Info(ctx context.Context, msg string, attrs ...slog.Attr)
- func (m *Telemetry) NewMeter(name string, options ...MeterOption) Meter
- func (m *Telemetry) Panic(ctx context.Context, msg string, attrs ...slog.Attr)
- func (m *Telemetry) Warn(ctx context.Context, msg string, attrs ...slog.Attr)
- func (m *Telemetry) WithCtx(ctx context.Context) context.Context
- type TraceConfig
- type Tracer
- type TracerConfig
- type TracerControl
- type TracerOption
- type TracerProvider
Constants ¶
View Source
const (
DefaultInstrumentationName = "go-wrapper/telemetry"
)
Variables ¶
View Source
var ErrMultipleInstance = errors.New("not allow to create multiple instances")
Functions ¶
Types ¶
type Config ¶
type Config struct { Provider Provider ProviderConfig ProviderConfig InstrumentationName string `env:"TEL_INSTRUMENTATION_NAME"` ServiceName string `env:"TEL_SERVICE_NAME"` }
func (*Config) ApplyOptions ¶
type ContextKey ¶
type ContextKey struct{}
type Logger ¶
type Logger interface { Debug(ctx context.Context, msg string, attrs ...slog.Attr) Info(ctx context.Context, msg string, attrs ...slog.Attr) Warn(ctx context.Context, msg string, attrs ...slog.Attr) Error(ctx context.Context, msg string, attrs ...slog.Attr) Panic(ctx context.Context, msg string, attrs ...slog.Attr) }
type LoggerConfig ¶
type LoggerConfig struct { }
type LoggerControl ¶
type LoggerControl interface { LoggerProvider Shutdown(ctx context.Context) error }
type LoggerOption ¶
type LoggerOption func(config *LoggerConfig)
type LoggerProvider ¶
type LoggerProvider interface {
NewLogger(options ...LoggerOption) Logger
}
type MeterConfig ¶
type MeterConfig struct { }
type MeterControl ¶
type MeterControl interface { MeterProvider Shutdown(ctx context.Context) error }
type MeterOption ¶
type MeterOption func(config *MeterConfig)
type MeterProvider ¶
type MeterProvider interface {
NewMeter(name string, options ...MeterOption) Meter
}
type MetricConfig ¶
type NoopLog ¶
type NoopLog struct{}
func NewNoopLoggerControl ¶
func (*NoopLog) NewLogger ¶
func (m *NoopLog) NewLogger(options ...LoggerOption) Logger
type NoopMetric ¶
type NoopMetric struct{}
func NewNoopMetricControl ¶
func NewNoopMetricControl(_ MetricConfig) *NoopMetric
func (*NoopMetric) NewMeter ¶
func (m *NoopMetric) NewMeter(name string, options ...MeterOption) Meter
type NoopPropagate ¶
type NoopPropagate struct{}
func NewNoopPropagatorControl ¶
func NewNoopPropagatorControl(_ PropagateConfig) *NoopPropagate
type NoopProvide ¶
type NoopProvide struct{}
func NewNoopProvider ¶
func NewNoopProvider() *NoopProvide
func (*NoopProvide) CollectorEndpoint ¶
func (m *NoopProvide) CollectorEndpoint() string
func (*NoopProvide) NewLogControl ¶
func (m *NoopProvide) NewLogControl(cfg LogConfig) (LoggerControl, error)
func (*NoopProvide) NewMetricControl ¶
func (m *NoopProvide) NewMetricControl(cfg MetricConfig) (MeterControl, error)
func (*NoopProvide) NewPropagateControl ¶
func (m *NoopProvide) NewPropagateControl(cfg PropagateConfig) (PropagatorControl, error)
func (*NoopProvide) NewTraceControl ¶
func (m *NoopProvide) NewTraceControl(cfg TraceConfig) (TracerControl, error)
type NoopTrace ¶
type NoopTrace struct{}
func (*NoopTrace) NewTracer ¶
func (m *NoopTrace) NewTracer(options ...TracerOption) Tracer
type Option ¶
type Option func(config *Config)
Option
WithProvider
WithProviderConfig
WithServiceName
WithInstrumentationName
func WithInstrumentationName ¶
func WithProvider ¶
func WithProviderConfig ¶
func WithProviderConfig(cfg ProviderConfig) Option
func WithServiceName ¶
type PropagateConfig ¶
type PropagateConfig struct {
Enabled bool `env:"TEL_PROPAGATE_ENABLED"`
}
type Propagator ¶
type Propagator interface{}
type PropagatorControl ¶
type PropagatorControl interface { Propagator Shutdown(ctx context.Context) error }
type Provider ¶
type Provider interface { NewPropagateControl(cfg PropagateConfig) (PropagatorControl, error) NewLogControl(cfg LogConfig) (LoggerControl, error) NewTraceControl(cfg TraceConfig) (TracerControl, error) NewMetricControl(cfg MetricConfig) (MeterControl, error) CollectorEndpoint() string }
type ProviderConfig ¶
type ProviderConfig struct { Propagate PropagateConfig Log LogConfig Trace TraceConfig Metric MetricConfig }
type Telemetry ¶
type Telemetry struct {
// contains filtered or unexported fields
}
func (*Telemetry) NewMeter ¶
func (m *Telemetry) NewMeter(name string, options ...MeterOption) Meter
type TraceConfig ¶
type TracerConfig ¶
type TracerConfig struct { }
type TracerControl ¶
type TracerControl interface { TracerProvider Shutdown(ctx context.Context) error }
func NewNoopTracerControl ¶
func NewNoopTracerControl(_ TraceConfig) TracerControl
type TracerOption ¶
type TracerOption func(config *TracerConfig)
type TracerProvider ¶
type TracerProvider interface {
NewTracer(options ...TracerOption) Tracer
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.