Documentation
¶
Index ¶
- func Error(span trace.Span, err error, msg string)
- func InstrumentHTTPClient(client *http.Client) *http.Client
- func InstrumentLambdaHandler(handlerFunc interface{}) interface{}
- func InstrumentRedisClient(client *redis.ClusterClient) *redis.ClusterClient
- func SetupClientTelemetry(ctx context.Context) (func(context.Context) error, error)
- func SetupTelemetry(ctx context.Context, cfg *aws.Config, opts ...TelemetryOption) (func(context.Context), error)
- func StartSpan(ctx context.Context, name string) (context.Context, trace.Span)
- type SentryExceptionCaptureFunc
- type SentryLogger
- func (s *SentryLogger) Debug(args ...any)
- func (s *SentryLogger) Debugf(format string, args ...any)
- func (s *SentryLogger) Error(args ...any)
- func (s *SentryLogger) Errorf(format string, args ...any)
- func (s *SentryLogger) Fatal(args ...any)
- func (s *SentryLogger) Fatalf(format string, args ...any)
- func (s *SentryLogger) Info(args ...any)
- func (s *SentryLogger) Infof(format string, args ...any)
- func (s *SentryLogger) Panic(args ...any)
- func (s *SentryLogger) Panicf(format string, args ...any)
- func (s *SentryLogger) Warn(args ...any)
- func (s *SentryLogger) Warnf(format string, args ...any)
- type TelemetryOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstrumentLambdaHandler ¶
func InstrumentLambdaHandler(handlerFunc interface{}) interface{}
func InstrumentRedisClient ¶
func InstrumentRedisClient(client *redis.ClusterClient) *redis.ClusterClient
func SetupClientTelemetry ¶ added in v1.12.1
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.
Types ¶
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