# boop_error_tracker usage rules

boop_error_tracker pushes ErrorTracker errors to the developer's phone through Boop. It attaches to ErrorTracker's telemetry events; it does not replace, wrap, or configure ErrorTracker, and it has no database.

- Requires `error_tracker` installed and configured by the host app, and `boop_ex` configured with `url` and `api_key` (see boop_ex's usage rules). Add both deps; this package only listens.
- Configure in `config/runtime.exs`:

  ```elixir
  config :boop_error_tracker,
    environment: config_env(),
    source: "my_app",
    notify_on: [:new, :unresolved],
    throttle: :timer.minutes(10),
    error_tracker_url: "https://my-app.com/dev/errors",
    enabled: config_env() == :prod
  ```

- Nothing else is needed: the telemetry handler attaches when the `:boop_error_tracker` application starts. Do not call `BoopErrorTracker.attach/0` from the host app's supervision tree or `Application.start/2`; use it only in tests or after `detach/0`.
- `notify_on` values: `:new` (first time an error is seen), `:unresolved` (an error marked resolved in the ErrorTracker UI happens again), `:occurrence` (every occurrence, throttled per error by `throttle` milliseconds). Default `[:new, :unresolved]`; add `:occurrence` only when the user wants ongoing noise.
- Muted errors (muted in the ErrorTracker UI) are never sent. Do not add your own filtering for that.
- Every event is level `:error`; set `level: :critical` for prominent pushes. `source` defaults to `"error_tracker"`; set it to the app name.
- `in_app: [:my_app, :my_app_web]` pins which OTP applications count as in-app frames in the stacktrace. Without it, common framework apps are treated as not in-app.
- `tags: %{team: "web"}` adds static tags to every event. Occurrence context is sent as `context`; boop_ex redacts sensitive keys inside it.
- Always set `error_tracker_url` when the host app mounts the ErrorTracker dashboard: it is the public URL of the dashboard route plus `/errors` (e.g. router `error_tracker_dashboard "/dev/errors"` → `"https://my-app.com/dev/errors"`). Each push then has an "Open in ErrorTracker" button.
- `actions` adds more buttons: a list of `%{label, url}` or `fn error, occurrence -> [...] end`. Boop shows at most three in total; keep labels short (≤40 chars) and URLs absolute. A raising function is swallowed (the event is still sent).
- Events carry ErrorTracker's fingerprint, so Boop groups occurrences of one error into a single inbox row; do not override `fingerprint`.
- Sends use `Boop.send_async/2`: nothing blocks the process that raised, and failures are logged, never raised. Do not wrap in `try/rescue`.
- Set `enabled: false` in `config/test.exs`.
