BoopErrorTracker (BoopErrorTracker v1.0.0)

Copy Markdown View Source

Sends ErrorTracker errors to your phone through Boop.

ErrorTracker deliberately does not do notifications; this package attaches to the telemetry events it emits and turns them into Boop events. It never touches ErrorTracker's database or configuration, and it uses the boop_ex client to send.

Setup

Install error_tracker and configure it as usual, then add this package and boop_ex:

config :boop_ex,
  url: System.fetch_env!("BOOP_URL"),
  api_key: System.fetch_env!("BOOP_API_KEY")

config :boop_error_tracker,
  environment: config_env(),      # tag on every event; default: unknown
  source: "my_app",               # Boop `source`; default "error_tracker"
  notify_on: [:new, :unresolved], # see below
  throttle: :timer.minutes(10)    # per-error minimum gap for :occurrence notifications

The handler attaches automatically when the :boop_error_tracker application starts. Set enabled: false to keep it off (for example in test).

What triggers a notification

ErrorTracker emits telemetry when an error is first seen, when a resolved error comes back, and for every occurrence. notify_on picks which of those become pushes:

  • :new — a brand-new error ([:error_tracker, :error, :new]). Default on.
  • :unresolved — an error that was marked resolved happens again. Default on.
  • :occurrence — every occurrence of any error, throttled per error by throttle. Default off; turn it on if you want to hear about ongoing errors, not just new ones.

Muted errors are never sent. All events use level :error; set level: :critical to make pushes prominent.

Summary

Functions

Attaches the telemetry handler. Called automatically on application start; safe to call again.

Whether the handler is currently attached.

Detaches the telemetry handler.

Functions

attach()

@spec attach() :: :ok | {:error, :already_exists}

Attaches the telemetry handler. Called automatically on application start; safe to call again.

attached?()

@spec attached?() :: boolean()

Whether the handler is currently attached.

detach()

@spec detach() :: :ok | {:error, :not_found}

Detaches the telemetry handler.