Documentation
¶
Overview ¶
Package tel provides OpenTelemetry integration for observability.
This file implements logging functionality with multi-handler support, combining standard slog handlers with OpenTelemetry bridges.
Package tel contains opentelemetry helpers.
Index ¶
- func BuiltinAttributeFlatStrings() lists.List[string]
- func BuiltinAttributeStrings() lists.List[string]
- func BuiltinAttributes() lists.List[attribute.KeyValue]
- func Do(s trace.Span, err *error)
- func Fingerprint() (hostname string, ip, mac []string, ns string)
- func Logger(name string) *slog.Logger
- func SetupLoggersCreated(p log.LoggerProvider)
- func SetupOTelLog(ctx context.Context, res *resource.Resource, remote Remote, ...) (l *log.LoggerProvider, err error)
- func SetupOTelSDK(ctx context.Context, name string, config OpenTelemetry) (shutdown func(context.Context) error, err error)
- func SetupTracer(t *trace.Tracer)
- func Span(ctx *context.Context, name string) (span trace.Span)
- type Closable
- type Metric
- type MultiHandler
- type OpenTelemetry
- type Protocol
- type Remote
- type SimpleCounter
- type SimpleGauge
- type SimpleHistogram
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuiltinAttributeStrings ¶
func Fingerprint ¶
func SetupLoggersCreated ¶
func SetupLoggersCreated(p log.LoggerProvider)
func SetupOTelLog ¶
func SetupOTelSDK ¶
func SetupOTelSDK(ctx context.Context, name string, config OpenTelemetry) ( shutdown func(context.Context) error, err error)
SetupOTelSDK bootstraps the OpenTelemetry pipeline. If it does not return an error, make sure to call shutdown for proper cleanup. reference https://opentelemetry.io/docs/languages/go/getting-started/
Types ¶
type MultiHandler ¶
type MultiHandler struct {
// contains filtered or unexported fields
}
type OpenTelemetry ¶
type SimpleCounter ¶
type SimpleCounter interface {
Add(ctx context.Context, incr int64, options ...metric.AddOption) SimpleCounter
Error() error
}
func Counter ¶
func Counter(name string) SimpleCounter
type SimpleGauge ¶
type SimpleGauge interface {
Error() error
}
func Gauge ¶
func Gauge(name string) SimpleGauge
type SimpleHistogram ¶
type SimpleHistogram interface {
Record(ctx context.Context, incr float64, options ...metric.RecordOption) SimpleHistogram
Error() error
}
func Histogram ¶
func Histogram(name string) SimpleHistogram
Click to show internal directories.
Click to hide internal directories.