View Source Zexbox.Telemetry (Zexbox v1.4.0)

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

Summary

Functions

Attaches the given handler to the specified event.

Types

callback()

@type callback() :: (event_name(),
               event_measurements :: map(),
               event_metadata :: map(),
               handler_config :: any() ->
                 any())

config()

@type config() :: any()

event_name()

@type event_name() :: any()

event_params()

@type event_params() :: [atom() | :stop]

Functions

attach(event, params, function, config)

@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