Sentry
The Sentry integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] connects Home Assistant to Sentry, an error tracking service that can be cloud-hosted or self-hosted. It captures logged errors and unhandled exceptions and sends them to your Sentry instance, where you can browse, search, and get alerted on them.
This is mainly useful if you develop custom integrations or want deeper insight into errors happening inside your Home Assistant instance. Sentry groups repeated errors, shows stack traces, and can notify you when new issues appear, so you do not have to watch the logs manually.
A free Sentry account includes 5000 events per month. Depending on how many events Home Assistant sends, you may need to upgrade your Sentry account or accept periods without data flowing from Home Assistant to Sentry.
Prerequisites
You need a Sentry account and a DSN. The DSN tells Home Assistant where to send error events.
To get your DSN:
- Go to Projects.
- Select Create project.
- Fill out the Give your project a name field, assign a team, and then select Create project.
- Select the Get your DSN link at the top of the page. Your DSN looks like
https://[email protected]/0.
Configuration
To add the Sentry service to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Sentry.
-
Follow the instructions on screen to complete the setup.
Configuration options
After setup, you can fine-tune what Home Assistant sends to Sentry. Go to Settings > Devices & services, select the Sentry integration, and then select the cogwheel
- The log level Sentry will register an event for: The minimum log level that creates a Sentry event. Defaults to error.
- The log level Sentry will record events as breadcrumbs for: The minimum log level recorded as breadcrumbs, which add context leading up to an event. Defaults to warning.
-
Optional name of the environment: A label, such as
productionordevelopment, to separate events in Sentry. - Send handled events: Also send errors that Home Assistant already caught and handled. Off by default.
- Send events from custom components: Include errors that originate from custom integrations. Off by default.
- Send events from third-party packages: Include errors that originate from third-party Python packages. Off by default.
- Enable performance tracing: Send performance tracing data to Sentry. Off by default.
- Tracing sample rate: The fraction of traces to send when tracing is enabled, between 0.0 and 1.0 (1.0 sends all of them). Defaults to 1.0.
After changing these options, restart Home Assistant to apply them.
Supported functionality
The Sentry integration does not add any entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more]. Once set up, it runs in the background and forwards errors and unhandled exceptions to your Sentry instance as they happen. Each event is enriched with context about your installation, such as the integrations in use, to help with debugging.
Data updates
Sentry does not poll for data. Home Assistant sends events to your Sentry instance as errors occur.
Removing the integration
This integration follows standard integration removal. No extra steps are required.
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- From the list of devices, select the integration instance you want to remove.
- Next to the entry, select the three dots
menu. Then, select Delete.