otelx

package
v0.0.0-...-252f0a0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GCPReplacer

func GCPReplacer(groups []string, a slog.Attr) slog.Attr

func TraceHandler

func TraceHandler(h http.Handler, opts ...otelhttp.Option) http.Handler

Types

type CloudLoggingHandler

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

func NewCloudLoggingHandler

func NewCloudLoggingHandler(projectID string, opts *slog.HandlerOptions) *CloudLoggingHandler

CloudLoggingHandler is a slog.Handler which adds attributes from the span context.

func (*CloudLoggingHandler) Enabled

func (h *CloudLoggingHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*CloudLoggingHandler) Handle

func (h *CloudLoggingHandler) Handle(ctx context.Context, record slog.Record) error

Handle overrides slog.Handler's Handle method. This adds attributes from the span context to the slog.Record.

func (*CloudLoggingHandler) WithAttrs

func (h *CloudLoggingHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*CloudLoggingHandler) WithGroup

func (h *CloudLoggingHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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