1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

35 lines
1.3 KiB
Markdown
Raw Normal View History

2022-05-11 14:13:50 -04:00
# Error Reporting
## Sentry
2022-05-12 09:35:13 -04:00
### Enabling Error Reporting
NetBox supports native integration with [Sentry](https://sentry.io/) for automatic error reporting. To enable this functionality, set `SENTRY_ENABLED` to True and define your unique [data source name (DSN)](https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/) in `configuration.py`.
2022-05-11 14:13:50 -04:00
```python
SENTRY_ENABLED = True
2022-05-12 09:35:13 -04:00
SENTRY_DSN = "https://examplePublicKey@o0.ingest.sentry.io/0"
2022-05-11 14:13:50 -04:00
```
Setting `SENTRY_ENABLED` to False will disable the Sentry integration.
2022-05-12 09:35:13 -04:00
### Assigning Tags
2022-05-11 14:13:50 -04:00
You can optionally attach one or more arbitrary tags to the outgoing error reports if desired by setting the `SENTRY_TAGS` parameter:
```python
SENTRY_TAGS = {
"custom.foo": "123",
"custom.bar": "abc",
}
```
2022-05-12 09:35:13 -04:00
!!! warning "Reserved tag prefixes"
Avoid using any tag names which begin with `netbox.`, as this prefix is reserved by the NetBox application.
### Testing
2022-05-11 14:13:50 -04:00
Once the configuration has been saved, restart the NetBox service.
2022-05-12 09:35:13 -04:00
To test Sentry operation, try generating a 404 (page not found) error by navigating to an invalid URL, such as `https://netbox/404-error-testing`. (Be sure that debug mode has been disabled.) After receiving a 404 response from the NetBox server, you should see the issue appear shortly in Sentry.