req 0.7, on Elixir 1.18.
Send errors with OpenTelemetry
1
Add the dependencies
mix.exs
2
Start the instrumentation
lib/my_app/application.ex
3
Set the exporter variables
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 withreq:
lib/squasher.ex
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 tohttps://<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 callSquasher.capture_exception.
Next steps
OpenTelemetry
See which OTLP data Squasher accepts.
HTTP API
See every field of the ingest endpoint.