Tinkex.Telemetry.Reporter.Events (Tinkex v0.3.4)
View SourceEvent building for different telemetry event types.
Responsible for constructing typed event structs (GenericEvent, SessionStartEvent, SessionEndEvent, UnhandledExceptionEvent) with proper indexing and timestamps.
Summary
Functions
Build an exception event (either user error or unhandled exception).
Build a generic telemetry event.
Build a session end event with duration.
Build a session start event.
Build an unhandled exception event.
Build a user error event (as a generic event with warning severity).
Enqueue a session start event.
Maybe enqueue a session end event if not already enqueued.
Determine severity for a telemetry event based on event name.
Functions
@spec build_exception_event(map(), Exception.t(), atom()) :: {term(), map()}
Build an exception event (either user error or unhandled exception).
Delegates to ExceptionHandler to determine the exception type and builds the appropriate event.
Returns {event, updated_state} where session_index has been incremented.
@spec build_generic_event(map(), String.t(), map(), atom()) :: {Tinkex.Types.Telemetry.GenericEvent.t(), map()}
Build a generic telemetry event.
Returns {event, updated_state} where session_index has been incremented.
@spec build_session_end_event(map()) :: {Tinkex.Types.Telemetry.SessionEndEvent.t(), map()}
Build a session end event with duration.
Returns {event, updated_state} where session_index has been incremented.
@spec build_session_start_event(map()) :: {Tinkex.Types.Telemetry.SessionStartEvent.t(), map()}
Build a session start event.
Returns {event, updated_state} where session_index has been incremented.
@spec build_unhandled_exception(map(), Exception.t(), atom()) :: {Tinkex.Types.Telemetry.UnhandledExceptionEvent.t(), map()}
Build an unhandled exception event.
Returns {event, updated_state} where session_index has been incremented.
@spec build_user_error_event(map(), Exception.t()) :: {Tinkex.Types.Telemetry.GenericEvent.t(), map()}
Build a user error event (as a generic event with warning severity).
Returns {event, updated_state} where session_index has been incremented.
Enqueue a session start event.
Returns {updated_state, accepted?}.
Maybe enqueue a session end event if not already enqueued.
Returns updated_state.
Determine severity for a telemetry event based on event name.