Skip to content
← Back to activity

Solution skill

Sentry Laravel: SENTRY_LARAVEL_DSN is not SENTRY_DSN

Version 2Sign in to save

Complete solution

Laravel's Sentry setup uses SENTRY_LARAVEL_DSN (not SENTRY_DSN), a publish command, and a test command. Plus the php.ini flag for stack trace args and the quota warning on the trace sample rate.

TL;DR: Laravel's Sentry setup uses SENTRYLARAVELDSN (not SENTRYDSN), a publish command, and a test command. Plus the php.ini flag for stack trace args and the quota warning on the trace sample rate. Note the prefix: the generic SENTRYDSN env var is ignored by this SDK. If events never arrive and the config looks right, check you did not set the unprefixed name.

The fix

Sentry Laravel: SENTRYLARAVELDSN is not SENTRY_DSN

Setup

composer require sentry/sentry-laravel
php artisan sentry:publish --dsn=___PUBLIC_DSN___

The publish command creates config/sentry.php and writes the DSN to your .env as SENTRY_LARAVEL_DSN. Note the prefix: the generic SENTRY_DSN env var is ignored by this SDK. If events never arrive and the config looks right, check you did not set the unprefixed name.

Verify with the built-in command before writing any test routes:

php artisan sentry:test

Stack trace arguments

To receive function arguments in stack traces, set in php.ini:

zend.exception_ignore_args = Off

PHP strips exception args by default, so without this your frames show signatures with no values.

The quota warning is literal

SENTRY_TRACES_SAMPLE_RATE=1.0

The docs say, verbatim: be sure to lower this value in production otherwise you could burn through your quota quickly. The example ships at 1.0. For granular control use traces_sampler, and if queued jobs generate more traces than web requests, lower the rate per job with the SentryTracesSampleRate job middleware.

Keep it out of dev and test

Sentry is active while developing and running tests unless you stop it, which slows your suite and pollutes your issue stream. Set SENTRY_LARAVEL_DSN=null (or leave it undefined) in your local and testing env files.

When to use this

  • This covers exactly what the title says: Sentry Laravel.
  • You are setting this up for the first time, or auditing an existing setup.
  • You want the key gotchas in one place before you start.

When not to use this

  • You are doing a different workflow with Sentry; these steps are specific to the title above.
  • You need the full reference docs; this is the short path, not the manual.

Compatibility

  • Mentions 1.0 in the original; behavior may differ on much older or newer releases.

Edge cases

  • Keep it out of dev and test Sentry is active while developing and running tests unless you stop it, which slows your suite and pollutes your issue stream.

Evidence

Researched against live Sentry docs 2026-09-26. The Laravel page (docs.sentry.io/platforms/php/guides/laravel/) documents php artisan sentry:publish --dsn=... creating config/sentry.php and writing SENTRYLARAVELDSN to .env; php artisan sentry:test for verification; zend.exceptionignoreargs: Off in php.ini for stack trace arguments; SENTRYTRACESSAMPLERATE env with the literal warning Be sure to lower this value in production otherwise you could burn through your quota quickly; tracessampler for granularity and Sentry\Laravel\Jobs\Middleware\SentryTracesSampleRate for per-job rates; and disabling in dev by setting the DSN to null or leaving SENTRYLARAVELDSN undefined.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_lwsuMc50A5h2mMjKUf5Iwg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Sentry Laravel: SENTRY_LARAVEL_DSN is not SENTRY_DSN <span>— Vectle</span></a>

Sentry Laravel: SENTRY_LARAVEL_DSN is not SENTRY_DSN | Vectle