observability

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestIDHeader = "X-Request-ID"
)

Variables

This section is empty.

Functions

func AttachUserToFiberContext

func AttachUserToFiberContext(c *fiber.Ctx)

func BackgroundFromContext

func BackgroundFromContext(ctx context.Context) context.Context

func ExtractNATSContext

func ExtractNATSContext(ctx context.Context, msg *nats.Msg) context.Context

func InjectMapCarrier

func InjectMapCarrier(ctx context.Context, carrier propagation.TextMapCarrier)

func InjectNATSHeaders

func InjectNATSHeaders(ctx context.Context, headers nats.Header) nats.Header

func Logger

func Logger() *slog.Logger

func LoggerFromFiber

func LoggerFromFiber(c *fiber.Ctx, logger *slog.Logger) *slog.Logger

func LoggerWithContext

func LoggerWithContext(ctx context.Context, logger *slog.Logger) *slog.Logger

func Meter

func Meter(scope string) metric.Meter

func NewHTTPClient

func NewHTTPClient(base *http.Client, name string) *http.Client

func NewHTTPTransport

func NewHTTPTransport(name string, base http.RoundTripper) http.RoundTripper

func RedactEmail

func RedactEmail(email string) string

func RedactSecret

func RedactSecret(value string) string

func RequestContextMiddleware

func RequestContextMiddleware() fiber.Handler

func RequestIDFromContext

func RequestIDFromContext(ctx context.Context) string

func RequestLogger

func RequestLogger(logger *slog.Logger) fiber.Handler

func SetDependencyResult

func SetDependencyResult(ctx context.Context, result string)

func StartDependencySpan

func StartDependencySpan(ctx context.Context, system, operation, target string, attrs ...attribute.KeyValue) (context.Context, func(error))

func StartNATSConsumeSpan

func StartNATSConsumeSpan(ctx context.Context, subject string) (context.Context, func(error))

func StartNATSPublishSpan

func StartNATSPublishSpan(ctx context.Context, subject string) (context.Context, func(error))

func Tracer

func Tracer(scope string) trace.Tracer

Types

type HTTPServerTelemetry

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

func NewHTTPServerTelemetry

func NewHTTPServerTelemetry(serviceName string) *HTTPServerTelemetry

func (*HTTPServerTelemetry) Middleware

func (t *HTTPServerTelemetry) Middleware() fiber.Handler

type Runtime

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

func Init

func Init(serviceName string, attrs ...attribute.KeyValue) (*Runtime, error)

func (*Runtime) Close

func (r *Runtime) Close() error

func (*Runtime) Logger

func (r *Runtime) Logger() *slog.Logger

func (*Runtime) Meter

func (r *Runtime) Meter(scope string) metric.Meter

func (*Runtime) Tracer

func (r *Runtime) Tracer(scope string) trace.Tracer

type SFUTelemetry

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

func NewSFUTelemetry

func NewSFUTelemetry(serviceName string, attrs ...attribute.KeyValue) *SFUTelemetry

func (*SFUTelemetry) AdminClose

func (t *SFUTelemetry) AdminClose(ctx context.Context, started time.Time, status string, attrs ...attribute.KeyValue)

func (*SFUTelemetry) Answer

func (t *SFUTelemetry) Answer(ctx context.Context, direction string, attrs ...attribute.KeyValue)

func (*SFUTelemetry) BitrateDisconnect

func (t *SFUTelemetry) BitrateDisconnect(ctx context.Context, attrs ...attribute.KeyValue)

func (*SFUTelemetry) Candidate

func (t *SFUTelemetry) Candidate(ctx context.Context, direction string, attrs ...attribute.KeyValue)

func (*SFUTelemetry) ChannelDelta

func (t *SFUTelemetry) ChannelDelta(ctx context.Context, delta int64)

func (*SFUTelemetry) ConnectionState

func (t *SFUTelemetry) ConnectionState(ctx context.Context, state string, attrs ...attribute.KeyValue)

func (*SFUTelemetry) Heartbeat

func (t *SFUTelemetry) Heartbeat(ctx context.Context, started time.Time, status string, attrs ...attribute.KeyValue)

func (*SFUTelemetry) Join

func (t *SFUTelemetry) Join(ctx context.Context, attrs ...attribute.KeyValue)

func (*SFUTelemetry) Leave

func (t *SFUTelemetry) Leave(ctx context.Context, started time.Time, attrs ...attribute.KeyValue)

func (*SFUTelemetry) Offer

func (t *SFUTelemetry) Offer(ctx context.Context, direction string, attrs ...attribute.KeyValue)

func (*SFUTelemetry) PeerDelta

func (t *SFUTelemetry) PeerDelta(ctx context.Context, delta int64, attrs ...attribute.KeyValue)

func (*SFUTelemetry) Renegotiation

func (t *SFUTelemetry) Renegotiation(ctx context.Context, attrs ...attribute.KeyValue)

func (*SFUTelemetry) TrackDelta

func (t *SFUTelemetry) TrackDelta(ctx context.Context, kind string, delta int64, attrs ...attribute.KeyValue)

type WSTelemetry

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

func NewWSTelemetry

func NewWSTelemetry(serviceName string) *WSTelemetry

func (*WSTelemetry) AuthFailure

func (t *WSTelemetry) AuthFailure(ctx context.Context, reason string)

func (*WSTelemetry) ConnectionClosed

func (t *WSTelemetry) ConnectionClosed(ctx context.Context, started time.Time, attrs ...attribute.KeyValue)

func (*WSTelemetry) ConnectionOpened

func (t *WSTelemetry) ConnectionOpened(ctx context.Context, attrs ...attribute.KeyValue)

func (*WSTelemetry) Heartbeat

func (t *WSTelemetry) Heartbeat(ctx context.Context, result string)

func (*WSTelemetry) HeartbeatTimeout

func (t *WSTelemetry) HeartbeatTimeout(ctx context.Context)

func (*WSTelemetry) MessageIn

func (t *WSTelemetry) MessageIn(ctx context.Context, operation int, eventType *int)

func (*WSTelemetry) MessageOut

func (t *WSTelemetry) MessageOut(ctx context.Context, topic string, status string)

func (*WSTelemetry) OutboundDrop

func (t *WSTelemetry) OutboundDrop(ctx context.Context, topic string)

func (*WSTelemetry) SubscriptionDelta

func (t *WSTelemetry) SubscriptionDelta(ctx context.Context, kind string, delta int64)

Jump to

Keyboard shortcuts

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