otel

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 5 Imported by: 0

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

func NewObserver(meter metric.Meter, opts ...Option) gateway.Observer

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

func WithInstrumentPrefix(prefix string) Option

WithInstrumentPrefix overrides the "gateway." prefix prepended to every instrument name. An empty prefix registers the instruments under their bare names.

Jump to

Keyboard shortcuts

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