# `CredoHotUpgrades.Check.TelemetryLocalHandler`
[🔗](https://github.com/deployex/credo_hot_upgrades/blob/main/lib/credo_hot_upgrades/check/telemetry_local_handler.ex#L1)

## Basics

> #### This check is disabled by default. {: .neutral}
>
> [Learn how to enable it](`e:credo:config_file.html#checks`) via `.credo.exs`.

This check has a base priority of `high` and works with any version of Elixir.

## Explanation

`:telemetry.attach/4` and `:telemetry.attach_many/4` are called once, when
the application boots, and keep the handler function for as long as the
node lives. `:telemetry.attach(id, event, &handle_event/4, nil)` keeps a
capture of the module version that attached it.

After a hot upgrade of that module, the first event raises inside the
handler, and Telemetry detaches a handler that fails: from then on the
event is simply not handled, with one line in the log to say so.

Attach `&MyApp.Telemetry.handle_event/4`, an export of the current module
resolved by name, not a local capture or an anonymous function.

## Check-Specific Parameters

*There are no specific parameters for this check.*

## General Parameters

Like with all checks, [general params](`e:credo:check_params.html`) can be applied.

Parameters can be configured via the [`.credo.exs` config file](`e:credo:config_file.html`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
