hecate_plugin_telemetry (hecate_sdk v0.6.2)

View Source

Auto-attach telemetry handlers for evoq and reckon_db events.

Bridges existing telemetry events from the event sourcing stack into the hecate_plugin_metrics system. Called by the plugin loader when a plugin with an event store is loaded.

Each handler checks that the telemetry metadata's store_id matches the plugin's store before incrementing metrics — this ensures per-plugin metric isolation.

Summary

Functions

Attach telemetry handlers for a plugin's event store. PluginName is the plugin identifier (binary). StoreId is the atom store identifier from store_config().

Detach all telemetry handlers for a plugin.

Duration handler — sets a gauge metric with duration in microseconds.

Counter handler — increments a counter metric if store_id matches.

Functions

attach(PluginName, StoreId)

-spec attach(binary(), atom()) -> ok.

Attach telemetry handlers for a plugin's event store. PluginName is the plugin identifier (binary). StoreId is the atom store identifier from store_config().

detach(PluginName)

-spec detach(binary()) -> ok.

Detach all telemetry handlers for a plugin.

handle_duration_event(EventName, Measurements, Metadata, Config)

Duration handler — sets a gauge metric with duration in microseconds.

handle_event(EventName, Measurements, Metadata, Config)

Counter handler — increments a counter metric if store_id matches.