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 ¶
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.
Click to show internal directories.
Click to hide internal directories.