API Reference tlm v#0.1.0

Copy Markdown

Modules

Tlm

Reports your app's errors to Tlm.

What a process did just before it crashed: its last 50 log lines (info and above), plus Ecto queries for the repos in config :tlm, repos: [[:my_app, :repo]] (their telemetry prefixes).

Where events go and what they say about the app. Everything has a default, the DSN included: set TLM_DSN in the environment, or configure it yourself

Builds protocol v1 events (see Tlm's docs/protocol.md): plain string-keyed maps, ready to encode as JSON.

Tells Tlm the app is up: one heartbeat when the app starts, then one an hour, so a healthy app with no errors still shows as set up, along with its release, environment and SDK version.

An Erlang :logger handler that reports crashes and records breadcrumbs.

Reports Oban job failures. Attached on its own when Oban is loaded.

Attaches the current request to any error reported while handling it.

Sends events to Tlm in the background, one at a time, so that a slow or unreachable Tlm never slows the app down.

Source lines around a frame, so Tlm can show the failing line.

Turns an Elixir stacktrace into protocol frames, innermost first (the order Elixir already uses), each marked in_app when it is the app's own code. Tlm groups errors by those frames, so that mark is the most important thing this package gets right.

What Tlm.test_event/0 and mix tlm.test report: not a real error, just a check that events arrive.

Mix Tasks

Stores your app's lib/**/*.ex inside the tlm dependency's build, so a release, which ships no source files, can still send the lines around each frame of your code. It also records which file and line defines each module, which releases strip from the compiled code.

Sends one test event to Tlm, right away, and prints what it answered, to check the setup end to end