sentry/sentry
4.32 on PHP 8.5.
Send errors with the HTTP API
This function posts one error to the ingest endpoint with the curl extension:src/squasher.php
stack is shown as the stack trace on the issue page. To get your ingest key and project ID, see
Create an ingest key. See the
HTTP API for all fields.
Report every Laravel exception
In Laravel 11 and later, call the function from the exception handler inbootstrap/app.php:
bootstrap/app.php
src/squasher.php, add it to the autoload section of composer.json, and run
composer dump-autoload:
composer.json
Send errors with OpenTelemetry
1
Install the packages
php-http/guzzle7-adapter adds one. This guide uses
OTLP/HTTP. The gRPC transport is also supported at the Collector URL on port 443.2
Set the exporter variables
OTEL_PHP_AUTOLOAD_ENABLED, the SDK configures itself from these variables when Composer
loads it. OTLP requests do not need the project ID.3
Record errors on spans
recordException on a span without
the error status also makes an issue, titled with the exception message. The SDK sends the
spans when the PHP script ends.open-telemetry/opentelemetry-auto-laravel. They need the
opentelemetry PHP extension. This page does not cover that setup. Automatic
AI triage runs only on issues from the production environment.
Use the Sentry SDK for PHP
If your app already usessentry/sentry, point its DSN at Squasher. Squasher reads the gzip
envelopes that the SDK sends.
https://<ingest key>@ingest.squasher.ai/1. The ingest key selects the project; the SDK
needs a number at the end. Squasher keeps errors, traces, logs, metrics, and sessions from the SDK,
so you can keep tracing on. See Sentry for what each item becomes.
Send a test error
Run this once with the same environment variables:Give the setup to a coding agent
Copy this prompt into your coding agent to set up PHP the same way:Next steps
HTTP API
See every field of the ingest endpoint.
OpenTelemetry
See which OTLP data Squasher accepts.
Move from Sentry
Move an app from Sentry to Squasher.
Troubleshooting
Find out why an event does not appear.