observability

package
v0.1.39 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package observability provides observability features for the application.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedObservabilityType is returned when an unsupported observability type is specified.
	ErrUnsupportedObservabilityType = errors.New("unsupported observability type")

	// ErrNoImplementation is returned when no implementation is provided for the observability type.
	ErrNoImplementation = errors.New("no implementation provided for the observability type")

	// ErrInvalidPrometheusEndpoint is returned when the Prometheus endpoint is invalid.
	ErrInvalidPrometheusEndpoint = errors.New("invalid Prometheus endpoint URL")
)
View Source
var (
	// ErrUnsupportedCompressionAlgorithm is returned when an unsupported compression algorithm is specified.
	ErrUnsupportedCompressionAlgorithm = errors.New("unsupported compression algorithm")
	// ErrUnsupportedProtocol is returned when an unsupported trace protocol is specified.
	ErrUnsupportedProtocol = errors.New("unsupported trace protocol")
	// ErrInvalidTraceSampler is returned when an invalid trace sampler is specified.
	ErrInvalidTraceSampler = errors.New("invalid trace sampler")
)

Functions

This section is empty.

Types

type Service

type Service struct {
	MeterProvider     metricapi.MeterProvider
	TraceProvider     traceapi.TracerProvider
	TextMapPropagator propagation.TextMapPropagator
	Logger            *slog.Logger
	// contains filtered or unexported fields
}

Service provides observability features such as metrics and tracing.

func New

func New(
	settings *config.ObservabilitySettings,
	shutdownlistner *helper.ShutdownListener,
) (*Service, error)

New creates a new observability Service based on the provided settings.

func (*Service) Middleware

func (service *Service) Middleware() gin.HandlerFunc

Middleware returns a Gin middleware function that applies OpenTelemetry instrumentation.

func (*Service) RoutesInfos

func (service *Service) RoutesInfos() management.RoutesInfo

RoutesInfos returns the management routes provided by this service.

type UnsupportedLogFormatError

type UnsupportedLogFormatError struct {
	LogFormat config.LogFormat
}

UnsupportedLogFormatError is an error type that indicates an unsupported log format. It contains the unsupported log format.

func (*UnsupportedLogFormatError) Error

func (e *UnsupportedLogFormatError) Error() string

Error implements the error interface for UnsupportedLogFormatError.

Jump to

Keyboard shortcuts

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