observability

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package observability defines logging, tracing, and metrics abstractions.

Index

Constants

View Source
const (
	AttrCPID         = "cp_id"
	AttrCSMSInstance = "csms_instance"
	AttrAction       = "action"
	AttrMsgID        = "msg_id"
	AttrDirection    = "direction"
	AttrVersion      = "version"
	AttrError        = "err"
)

Structured log attribute keys, fixed across the library and codegen output.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics interface {
	ConnectionCount(version string, delta int)
	CallStarted(version, action, direction string)
	CallCompleted(version, action, direction string, dur time.Duration, status string)
	PendingCallCount(version string, delta int)
	SchemaValidationFailure(version, action, direction string)
}

Metrics receives library metrics. Default is NoOp; prom/otel subpackages provide real implementations.

type NoOp

type NoOp struct{}

NoOp is a Metrics implementation that does nothing.

func (NoOp) CallCompleted

func (NoOp) CallCompleted(string, string, string, time.Duration, string)

func (NoOp) CallStarted

func (NoOp) CallStarted(string, string, string)

func (NoOp) ConnectionCount

func (NoOp) ConnectionCount(string, int)

func (NoOp) PendingCallCount

func (NoOp) PendingCallCount(string, int)

func (NoOp) SchemaValidationFailure

func (NoOp) SchemaValidationFailure(string, string, string)

type Tracer

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

Tracer wraps an OTel tracer; the default is a no-op.

func NewTracer

func NewTracer(tp trace.TracerProvider) Tracer

NewTracer builds a Tracer from a TracerProvider. A nil provider yields a no-op.

func (Tracer) Start

func (t Tracer) Start(ctx context.Context, name string) (context.Context, trace.Span)

Start begins a span.

Directories

Path Synopsis
metrics
otel
Package otel implements observability.Metrics on top of the OpenTelemetry metrics API.
Package otel implements observability.Metrics on top of the OpenTelemetry metrics API.
prom
Package prom implements observability.Metrics using Prometheus.
Package prom implements observability.Metrics using Prometheus.

Jump to

Keyboard shortcuts

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