Documentation
¶
Overview ¶
Package otel provides an OpenTelemetry-backed implementation of gateway.Observer.
It maps the six Observer hooks onto OpenTelemetry metric instruments: the live connection count is an int64 up/down counter, while replacements, dropped and failed deliveries and broadcast fan-out are monotonic int64 counters. When the configured Observer also needs to report offline fallbacks it additionally satisfies gateway.OfflineObserver, so the same instance can be passed to WithObserver and cover every event a Registry emits.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewObserver ¶
NewObserver builds a gateway.Observer that records connection and delivery events on meter. Instrument creation errors are not fatal: the affected instrument falls back to a no-op so a partially misconfigured meter never breaks delivery. Passing a nil meter yields an Observer whose hooks are all no-ops.
Types ¶
type Option ¶
type Option func(*config)
Option customises an Observer built by NewObserver.
func WithGroupAttribute ¶
func WithGroupAttribute() Option
WithGroupAttribute records the connection group (and the broadcast topic) as a metric attribute. It is off by default because an unbounded set of groups produces an unbounded number of time series; enable it only when the group space is bounded.
func WithInstrumentPrefix ¶
WithInstrumentPrefix overrides the "gateway." prefix prepended to every instrument name. An empty prefix registers the instruments under their bare names.