masque_metrics (masque v0.7.0)

View Source

Metrics instrumentation for masque tunnels.

Uses instrument_meter to track tunnel lifecycle, throughput, and rejections. Call setup/0 from application start. Instruments are stored in persistent_term for zero-overhead lookups.

Summary

Functions

Idempotent allocator for the IP-side simple counters. Safe to call multiple times; only the first call wins (subsequent calls keep the existing reference so counts accumulated from earlier callers are preserved).

Functions

bytes_in(Bytes, Attrs)

-spec bytes_in(non_neg_integer(), map()) -> ok.

bytes_out(Bytes, Attrs)

-spec bytes_out(non_neg_integer(), map()) -> ok.

ip_advertise_inc()

-spec ip_advertise_inc() -> ok.

ip_advertised_count()

-spec ip_advertised_count() -> non_neg_integer().

ip_assign_inc()

-spec ip_assign_inc() -> ok.

ip_assigned_count()

-spec ip_assigned_count() -> non_neg_integer().

ip_drop_count(Reason)

-spec ip_drop_count(atom()) -> non_neg_integer().

ip_drop_inc(Reason)

-spec ip_drop_inc(atom()) -> ok.

ip_drop_reasons()

-spec ip_drop_reasons() -> [atom()].

ip_release_inc()

-spec ip_release_inc() -> ok.

ip_released_count()

-spec ip_released_count() -> non_neg_integer().

setup()

-spec setup() -> ok.

setup_ip_counters()

-spec setup_ip_counters() -> ok.

Idempotent allocator for the IP-side simple counters. Safe to call multiple times; only the first call wins (subsequent calls keep the existing reference so counts accumulated from earlier callers are preserved).

tunnel_closed(DurationMs, Attrs)

-spec tunnel_closed(number(), map()) -> ok.

tunnel_opened(Attrs)

-spec tunnel_opened(map()) -> ok.

tunnel_rejected(Attrs)

-spec tunnel_rejected(map()) -> ok.