Skip to main content
There is no Squasher SDK for Elixir. Use OpenTelemetry, or post errors to the HTTP API. This page is tested with the OpenTelemetry Erlang SDK 1.7 and exporter 1.11, and req 0.7, on Elixir 1.18.

Send errors with OpenTelemetry

1

Add the dependencies

mix.exs
Leave out the Phoenix and Bandit packages if your app does not use them.
2

Start the instrumentation

lib/my_app/application.ex
3

Set the exporter variables

The exporter sends OTLP over HTTP by default, which Squasher needs. OTLP requests do not need the project ID. To get a key, see Create an ingest key.
Automatic AI triage runs only on issues from the production environment, so set deployment.environment.name to production in production.

How errors become issues

A span with the error status becomes an issue. Squasher titles the issue with the status message, or with the span name when the message is empty. An exception recorded on a span without the error status also becomes an issue, titled with the exception message. To report an error that you rescue, record it on a span and set the status:
record_exception alone also makes an issue. The issue page shows the stack trace that you pass to record_exception.

Send errors with the HTTP API

This module posts one error to the ingest endpoint with req:
lib/squasher.ex
Call it where you rescue an error:
stack is shown as the stack trace on the issue page. See the HTTP API for all fields.

Sentry SDK for Elixir

If your app already uses the Sentry SDK for Elixir, set its DSN to https://<ingest key>@ingest.squasher.ai/1. The ingest key selects the project; the SDK needs a number at the end. See Sentry for what Squasher keeps from the SDK.

Send a test error

  • OpenTelemetry: in a span, run Tracer.set_status(:error, "Squasher test error").
  • HTTP API: rescue raise "Squasher test error" and call Squasher.capture_exception.
Then select Issues in the sidebar of your project. If the error does not appear, see Troubleshooting.

Next steps

OpenTelemetry

See which OTLP data Squasher accepts.

HTTP API

See every field of the ingest endpoint.