---
title: "Error Tracking — Depfloy docs"
description: "Collect a Laravel application's exceptions in Depfloy: set up the plugin, install sentry/sentry-laravel, and see how each plan's monthly event quota and retention work."
url: "https://depfloy.com/docs/error-tracking"
---

# Error Tracking

Error Tracking collects the exceptions your Laravel application reports and groups them into issues in the project's **Errors** section. Depfloy writes the DSN into the project's environment and tags every event with the commit that is live, so an error points back to the deployment that shipped it.

Error Tracking is on every plan. The plans differ in how many events an organization can send each month and how long Depfloy keeps them:

| Plan | Events per month | Retention |
| --- | --- | --- |
| Free | 1,000 | 7 days |
| Starter | 5,000 | 14 days |
| Pro | 50,000 | 30 days |
| Business | 250,000 | 90 days |
| Scale | 1,000,000 | 180 days |

A trial uses Scale’s quota and retention. See [Pricing](https://depfloy.com/pricing).

## Set it up

Error Tracking is a plugin for Laravel projects. In the project’s **Summary**, open the **Laravel Plugins** box, click **Add Plugin** and pick **Error Tracking**. Choose where errors go:

-   **Send errors to Depfloy** — Depfloy creates a DSN for the project and writes it to the project’s environment. Depfloy stores the events, and they count toward the organization’s monthly quota. The plugin row shows `used of limit events · resets <date> · kept <n> days`.
-   **Use my own DSN** — paste the DSN another error tracking service issued you (`https://<key>@<host>/<project-id>`). Depfloy writes it to the environment and stores no events. The DSN is checked for its shape only; no test event is sent.

### Install the package

The application reports errors through `sentry/sentry-laravel`, which the plugin does not install for you:

```bash
composer require sentry/sentry-laravel
```

Commit the change and deploy. Until the package is in `vendor/`, each deploy log carries a warning and the plugin row shows **SDK Not Installed** with a **Check Again** button. The deploy itself does not fail.

### What Depfloy writes to the environment

| Line | When |
| --- | --- |
| `SENTRY_LARAVEL_DSN` | always |
| `SENTRY_TRACES_SAMPLE_RATE=0` | if the environment does not set it already |
| `SENTRY_SEND_DEFAULT_PII=false` | if the environment does not set it already |
| `SENTRY_ENVIRONMENT` | if the environment does not set it already; the project’s `APP_ENV`, or `production` |
| `SENTRY_RELEASE` | on every deploy and instant rollback: the full SHA of the commit being served |

`SENTRY_RELEASE` is what links an issue to the deployment that introduced it.

If the environment already sets `SENTRY_LARAVEL_DSN`, **Send errors to Depfloy** is refused. Choose **Use my own DSN**, or remove the line first.

[Previews](https://depfloy.com/docs/project-previews) copy the source project’s environment, DSN included. Their errors are reported with the environment `preview`.

## Change or remove it

The plugin row’s menu has:

-   **Rotate DSN** — Depfloy writes a new DSN, then revokes the old one. The application picks up the new DSN when it reads its environment again, usually on the next deploy; events sent with the old DSN until then are rejected.
-   **Use my own DSN** or **Send errors to Depfloy** — switch modes.
-   **Remove** — revokes the DSN and removes the lines Depfloy wrote, along with `SENTRY_RELEASE`. Lines you changed after setup stay as you left them. Issues already recorded stay until their retention ends.

Setting up, rotating and removing are refused while a deployment of the project is running.

## How errors are grouped

Events with the same exception type and the same frames from your own code become one issue. Line numbers are not part of the match, so adding a line above a `throw` does not open a new issue. When no frame from your code is available, the message decides, with numbers, quoted strings, UUIDs and long hex values masked: “User 42 not found” and “User 43 not found” are one issue. A `fingerprint` the SDK sends takes precedence.

## Quota and retention

-   The quota is counted per organization per calendar month. Events beyond it are refused with `429` until the next month and are not billed.
-   Owners and Admins get an email when the organization reaches 80% and 100% of the month’s events, once each per month. This email is always sent and cannot be turned off.
-   Every event is counted, but Depfloy stores the full body of at most 50 events per issue per hour. The rest add to the issue’s counts and chart without being stored.
-   Once a day, stored events older than the plan’s retention are deleted.

## Who can do what

| Action | Roles |
| --- | --- |
| View errors, their events and alert rules | Owner, Admin, Manager, Developer, Viewer |
| Resolve, ignore and delete errors | Owner, Admin, Manager, Developer |
| Set up error tracking, rotate its DSN and remove it | Owner, Admin, Manager |
| Edit error alert rules | Owner, Admin, Manager |

The DSN is shown to members who can edit the project’s environment.

## API and MCP

The plugin endpoints need the `error:configure` permission on the [API token](https://depfloy.com/docs/api-keys):

-   `POST /api/v1/projects/{project}/plugins/error_tracking` with `{mode: "depfloy" | "own", dsn?}` (`dsn` only for `own`)
-   `PUT /api/v1/projects/{project}/plugins/{plugin}/dsn` — rotate, or switch mode
-   `POST /api/v1/projects/{project}/plugins/{plugin}/check-sdk`
-   `DELETE /api/v1/projects/{project}/plugins/{plugin}`

Over [MCP](https://depfloy.com/docs/mcp), `setup_plugin` accepts `plugin: "error_tracking"` with `mode` and `dsn`, and needs the same permission. Error Tracking has no process, so it never appears in `list_project_daemons`.

Issues themselves, their actions, alert rules, the endpoint that opens an event from its id and the MCP tools that read them are covered in [Errors](https://depfloy.com/docs/project-errors) and [MCP](https://depfloy.com/docs/mcp#error-tracking).
