{"repo":"beam-telemetry/telemetry","free":true,"listed":false,"github":"https://github.com/beam-telemetry/telemetry","clone":"git clone https://github.com/beam-telemetry/telemetry.git","description":"Dynamic dispatching library for metrics and instrumentations.","language":"Erlang","stars":914,"topics":["elixir","metrics","instrumentation","events"],"license":"Apache-2.0","category":"analytics","readme_excerpt":"Telemetry Documentation Telemetry is a lightweight library for dynamic dispatching of events, with a focus on metrics and instrumentation. Any Erlang or Elixir library can use telemetry to emit events. Application code and other libraries can then hook into those events and run custom handlers. Note: this library is agnostic to tooling and therefore is not directly related to OpenTelemetry. For OpenTelemetry in the Erlang VM, see opentelemetry-erlang, and check opentelemetry telemetry to connect both libraries. Usage In a nutshell, you register a custom module and function to be invoked for certain events, which are executed whenever there is such an event. The event name is a list of atoms. Each event is composed of a numeric value and can have metadata attached to it. Let's look at an example. Imagine that you have a web application and you'd like to log latency and response status for each incoming request. With Telemetry, you can build a module which does exactly that whenever a response is sent. The first step is to execute a measurement. In Elixir: In Erlang: Then you can create a module to be invoked whenever the event happens. In Elixir: In Erlang: Important note: The handle event callback of each handler is invoked synchronously on each telemetry:execute call. Therefore, it is extremely important to avoid blocking operations. If you need to perform any action that is not immediate, consider offloading the work to a separate process (or a pool of processes) by sending","default_branch":null,"files":null,"tree":[],"storefront":"/r/beam-telemetry","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/beam-telemetry/telemetry/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}