Guide to Displaying All Telemetry Events in Elixir and Erlang Systems

236
clicks
Guide to Displaying All Telemetry Events in Elixir and Erlang Systems

Source: stratus3d.com

Type: Post

Trevor Brown's article focuses on utilizing Erlang's tracing features to observe telemetry events in Erlang and Elixir applications. Telemetry, an Erlang library, dispatches events to handlers, but it doesn't provide a direct way to see all of the events a system might generate. Brown describes how to work around this limitation by tracing `telemetry:execute/3` and `telemetry:span/3` function calls by incorporating specific tracing functions from the `dbg` module into development code for both Erlang and Elixir. For Erlang, the tracing code is added to the `user_default` module, while in Elixir, a module is defined in `.iex.exs`. Starting the tracing allows developers to see all events as they occur in real-time. Despite its usefulness in development, Brown cautions against using this method in production code due to the overhead of tracing.

© HashMerge 2024