View Source Zexbox.Telemetry (Zexbox v1.0.0)

A (very) thin wrapper around the :telemetry erlang module

Summary

Functions

Attaches the given handler to the specified event.

Types

@type callback() ::
  (event_name(),
   event_measurements :: map(),
   event_metadata :: map(),
   handler_config :: any() ->
     any())
@type config() :: any()
@type event_name() :: any()
@type event_params() :: [atom() | :stop]

Functions

Link to this function

attach(event, params, function, config)

View Source
@spec attach(event_name(), event_params(), callback(), config()) ::
  :ok | {:error, :already_exists}

Attaches the given handler to the specified event.

see :telemetry.attach/4 for more information

Examples

iex> Zexbox.Telemetry.attach(:my_event, [:my, :event], &MyAppHandler.my_handler/3, nil)
:ok