evoq_telemetry (evoq v1.14.1)
View SourceTelemetry utilities for evoq.
Provides helper functions for attaching telemetry handlers and formatting telemetry events.
Event Naming Convention
All events follow the pattern: [evoq, component, action, stage] where stage is one of: start | stop | exception
Example Usage
%% Attach a handler for all aggregate events
evoq_telemetry:attach_aggregate_handlers(my_handler, fun handle_event/4).
%% Attach a handler for specific events
evoq_telemetry:attach([evoq, aggregate, execute, start], my_handler, fun handle_event/4).
Summary
Functions
Attach a telemetry handler.
Attach a telemetry handler with config.
Attach handlers for all aggregate telemetry events.
Attach handlers for ALL evoq telemetry events.
Attach handlers for all event handler telemetry events.
Attach handlers for all process manager telemetry events.
Attach handlers for all projection telemetry events.
Detach a telemetry handler.
List all attached handlers.
Execute a function within a telemetry span. Emits start and stop (or exception) events.
Functions
-spec attach(atom() | [atom(), ...], atom(), fun(([atom(), ...], map(), map(), term()) -> term())) -> ok | {error, already_exists}.
Attach a telemetry handler.
-spec attach(atom() | [atom(), ...], atom(), fun(([atom(), ...], map(), map(), term()) -> term()), map()) -> ok | {error, already_exists}.
Attach a telemetry handler with config.
-spec attach_aggregate_handlers(atom(), fun()) -> ok.
Attach handlers for all aggregate telemetry events.
-spec attach_all_handlers(atom(), fun()) -> ok.
Attach handlers for ALL evoq telemetry events.
-spec attach_handler_handlers(atom(), fun()) -> ok.
Attach handlers for all event handler telemetry events.
-spec attach_pm_handlers(atom(), fun()) -> ok.
Attach handlers for all process manager telemetry events.
-spec attach_projection_handlers(atom(), fun()) -> ok.
Attach handlers for all projection telemetry events.
-spec detach(atom()) -> ok | {error, not_found}.
Detach a telemetry handler.
-spec list_handlers() -> [map()].
List all attached handlers.
Execute a function within a telemetry span. Emits start and stop (or exception) events.