telemetry

package
v1.13.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: Apache-2.0, MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(span trace.Span, err error, msg string)

func InstrumentHTTPClient

func InstrumentHTTPClient(client *http.Client) *http.Client

func InstrumentLambdaHandler

func InstrumentLambdaHandler(handlerFunc interface{}) interface{}

func InstrumentRedisClient

func InstrumentRedisClient(client *redis.ClusterClient) *redis.ClusterClient

func SetupClientTelemetry added in v1.12.1

func SetupClientTelemetry(ctx context.Context) (func(context.Context) error, error)

SetupClientTelemetry installs a minimal tracer provider for client-side usage so spans have valid IDs and trace context can be propagated. It uses an OTLP/HTTP exporter if OTEL_EXPORTER_OTLP_ENDPOINT is set; otherwise it runs with no exporter (noop span export) to avoid failing in CLI contexts.

func SetupTelemetry

func SetupTelemetry(ctx context.Context, cfg *aws.Config, opts ...TelemetryOption) (func(context.Context), error)

SetupTelemetry configures the OpenTelemetry SDK by setting up a global tracer provider. It also adds instrumentation middleware to the config so that all AWS SDK clients based on that config are instrumented. This function updates the configuration in place. It should be called before any AWS SDK clients are created.

func StartSpan

func StartSpan(ctx context.Context, name string) (context.Context, trace.Span)

Types

type SentryExceptionCaptureFunc

type SentryExceptionCaptureFunc func(err error) *sentry.EventID

type SentryLogger

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

SentryLogger is a logger that sends errors messages to Sentry for error, panic and fatal logs.

func NewSentryLogger

func NewSentryLogger(system string) *SentryLogger

NewSentryLogger returns a logger that sends errors messages to Sentry for error, panic and fatal logs.

Note: you should call sentry.Init before using the returned logger.

func (*SentryLogger) Debug

func (s *SentryLogger) Debug(args ...any)

func (*SentryLogger) Debugf

func (s *SentryLogger) Debugf(format string, args ...any)

func (*SentryLogger) Error

func (s *SentryLogger) Error(args ...any)

func (*SentryLogger) Errorf

func (s *SentryLogger) Errorf(format string, args ...any)

func (*SentryLogger) Fatal

func (s *SentryLogger) Fatal(args ...any)

func (*SentryLogger) Fatalf

func (s *SentryLogger) Fatalf(format string, args ...any)

func (*SentryLogger) Info

func (s *SentryLogger) Info(args ...any)

func (*SentryLogger) Infof

func (s *SentryLogger) Infof(format string, args ...any)

func (*SentryLogger) Panic

func (s *SentryLogger) Panic(args ...any)

func (*SentryLogger) Panicf

func (s *SentryLogger) Panicf(format string, args ...any)

func (*SentryLogger) Warn

func (s *SentryLogger) Warn(args ...any)

func (*SentryLogger) Warnf

func (s *SentryLogger) Warnf(format string, args ...any)

type TelemetryOption

type TelemetryOption func(*config) error

func WithBaseSampler

func WithBaseSampler(baseSampler tracesdk.Sampler) TelemetryOption

Jump to

Keyboard shortcuts

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