telemetry

package
v0.0.0-...-d23828c Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTraceID

func GetTraceID(ctx context.Context) string

func NewLoggerAdapter

func NewLoggerAdapter() (*zerolog.Logger, error)

NewLoggerAdapter NewLoggerAdapter

Types

type HttpTelemetry

type HttpTelemetry struct {
	Tracer                 otelTrace.Tracer
	Meter                  metric.Meter
	ShutdownTracerProvider func(context.Context) error
	ShutdownMeterProvider  func(context.Context) error
	ShutdownLoggerProvider func(context.Context) error
	// contains filtered or unexported fields
}

func NewHttpTelemetry

func NewHttpTelemetry(cfg config.Config) (*HttpTelemetry, error)

func (*HttpTelemetry) Error

func (t *HttpTelemetry) Error(ctx context.Context, msg string, args ...any)

func (*HttpTelemetry) ErrorSpan

func (t *HttpTelemetry) ErrorSpan(span otelTrace.Span, err error) error

func (*HttpTelemetry) Log

func (t *HttpTelemetry) Log(ctx context.Context, msg string)

func (*HttpTelemetry) ShutdownLogger

func (t *HttpTelemetry) ShutdownLogger(ctx context.Context) error

func (*HttpTelemetry) ShutdownMeter

func (t *HttpTelemetry) ShutdownMeter(ctx context.Context) error

func (*HttpTelemetry) ShutdownTracer

func (t *HttpTelemetry) ShutdownTracer(ctx context.Context) error

func (*HttpTelemetry) Start

func (*HttpTelemetry) StartRoot

func (t *HttpTelemetry) StartRoot(ctx context.Context, request *http.Request, spanName string) (context.Context, otelTrace.Span)

type Level

type Level LogLevel

func (Level) AsZerolog

func (l Level) AsZerolog() zerolog.Level

type LogLevel

type LogLevel string
const (
	TraceLevel   LogLevel = "trace"
	DebugLevel   LogLevel = "debug"
	InfoLevel    LogLevel = "info"
	WarningLevel LogLevel = "warning"
	ErrorLevel   LogLevel = "error"
	FatalLevel   LogLevel = "fatal"
	PanicLevel   LogLevel = "panic"
)

type LogOutput

type LogOutput string

type Telemeter

type Telemeter interface {
	StartRoot(ctx context.Context, request *http.Request, spanName string) (context.Context, otelTrace.Span)
	Start(ctx context.Context, spanName string, opts ...otelTrace.SpanStartOption) (context.Context, otelTrace.Span)
	ErrorSpan(span otelTrace.Span, err error) error
	ShutdownTracer(ctx context.Context) error
	ShutdownMeter(ctx context.Context) error
	ShutdownLogger(ctx context.Context) error
	Log(ctx context.Context, msg string)
	Error(ctx context.Context, msg string, args ...any)
}

Jump to

Keyboard shortcuts

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