observability

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTraceLoggerObservability

func NewTraceLoggerObservability(trace trace.Tracer, logger logger.LoggerInterface, counter *prometheus.CounterVec, duration *prometheus.HistogramVec) *traceLoggerObservability

NewTraceLoggerObservability creates a new traceLoggerObservability instance.

It takes context.Context, trace.Tracer, logger.LoggerInterface, prometheus.CounterVec, and prometheus.HistogramVec as input.

The returned traceLoggerObservability instance includes the input parameters and can be used to start tracing and logging, as well as recording metrics.

If the input context is canceled, the tracing and logging will be stopped.

Types

type TraceLoggerObservability

type TraceLoggerObservability interface {
	StartTracingAndLogging(ctx context.Context, method string, attrs ...attribute.KeyValue) (
		context.Context,
		trace.Span,
		func(string),
		string,
		func(string, ...zap.Field),
	)
	// RecordMetrics records a Prometheus metric for the given method and status.
	// It increments a counter and records the duration since the provided start time.
	RecordMetrics(method, status string, start time.Time)
}

TraceLoggerObservability provides tracing, logging, and request metrics.

Jump to

Keyboard shortcuts

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