diff --git a/docs/administration/error-reporting.md b/docs/administration/error-reporting.md index 8b4312273..10dc71f31 100644 --- a/docs/administration/error-reporting.md +++ b/docs/administration/error-reporting.md @@ -4,11 +4,13 @@ ### 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`. +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` via `SENTRY_CONFIG`. ```python SENTRY_ENABLED = True -SENTRY_DSN = "https://examplePublicKey@o0.ingest.sentry.io/0" +SENTRY_CONFIG = { + "dsn": "https://examplePublicKey@o0.ingest.sentry.io/0", +} ``` Setting `SENTRY_ENABLED` to False will disable the Sentry integration. diff --git a/docs/configuration/error-reporting.md b/docs/configuration/error-reporting.md index 2d287ef06..a3bc87355 100644 --- a/docs/configuration/error-reporting.md +++ b/docs/configuration/error-reporting.md @@ -16,27 +16,6 @@ The default configuration is shown below: Additionally, `http_proxy` and `https_proxy` are set to the HTTP and HTTPS proxies, respectively, configured for NetBox (if any). -## SENTRY_DSN - -!!! warning "This parameter will be removed in NetBox v4.5." - Set this using `SENTRY_CONFIG` instead: - - ``` - SENTRY_CONFIG = { - "dsn": "https://examplePublicKey@o0.ingest.sentry.io/0", - } - ``` - -Default: `None` - -Defines a Sentry data source name (DSN) for automated error reporting. `SENTRY_ENABLED` must be `True` for this parameter to take effect. For example: - -``` -SENTRY_DSN = "https://examplePublicKey@o0.ingest.sentry.io/0" -``` - ---- - ## SENTRY_ENABLED Default: `False` @@ -48,43 +27,6 @@ Set to `True` to enable automatic error reporting via [Sentry](https://sentry.io --- -## SENTRY_SAMPLE_RATE - -!!! warning "This parameter will be removed in NetBox v4.5." - Set this using `SENTRY_CONFIG` instead: - - ``` - SENTRY_CONFIG = { - "sample_rate": 0.2, - } - ``` - -Default: `1.0` (all) - -The sampling rate for errors. Must be a value between 0 (disabled) and 1.0 (report on all errors). - ---- - -## SENTRY_SEND_DEFAULT_PII - -!!! warning "This parameter will be removed in NetBox v4.5." - Set this using `SENTRY_CONFIG` instead: - - ``` - SENTRY_CONFIG = { - "send_default_pii": True, - } - ``` - -Default: `False` - -Maps to the Sentry SDK's [`send_default_pii`](https://docs.sentry.io/platforms/python/configuration/options/#send-default-pii) parameter. If enabled, certain personally identifiable information (PII) is added. - -!!! warning "Sensitive data" - If you enable this option, be aware that sensitive data such as cookies and authentication tokens will be logged. - ---- - ## SENTRY_TAGS An optional dictionary of tag names and values to apply to Sentry error reports.For example: @@ -101,20 +43,3 @@ SENTRY_TAGS = { --- -## SENTRY_TRACES_SAMPLE_RATE - -!!! warning "This parameter will be removed in NetBox v4.5." - Set this using `SENTRY_CONFIG` instead: - - ``` - SENTRY_CONFIG = { - "traces_sample_rate": 0.2, - } - ``` - -Default: `0` (disabled) - -The sampling rate for transactions. Must be a value between 0 (disabled) and 1.0 (report on all transactions). - -!!! warning "Consider performance implications" - A high sampling rate for transactions can induce significant performance penalties. If transaction reporting is desired, it is recommended to use a relatively low sample rate of 10% to 20% (0.1 to 0.2). diff --git a/docs/release-notes/version-4.7.md b/docs/release-notes/version-4.7.md new file mode 100644 index 000000000..5172727ac --- /dev/null +++ b/docs/release-notes/version-4.7.md @@ -0,0 +1,15 @@ +# NetBox v4.7 + +## v4.7.0 (FUTURE) + +### Breaking Changes + +* The following deprecated Sentry configuration parameters have been removed: `SENTRY_DSN`, `SENTRY_SAMPLE_RATE`, `SENTRY_SEND_DEFAULT_PII`, and `SENTRY_TRACES_SAMPLE_RATE`. Use the `SENTRY_CONFIG` parameter instead. + +### Enhancements + +### Other Changes + +* [#21883](https://github.com/netbox-community/netbox/issues/21883) - Drop support for deprecated Sentry configuration parameters + +### REST API Changes diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 33631f943..75e34a635 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -181,16 +181,8 @@ SECURE_HSTS_PRELOAD = getattr(configuration, 'SECURE_HSTS_PRELOAD', False) SECURE_HSTS_SECONDS = getattr(configuration, 'SECURE_HSTS_SECONDS', 0) SECURE_SSL_REDIRECT = getattr(configuration, 'SECURE_SSL_REDIRECT', False) SENTRY_CONFIG = getattr(configuration, 'SENTRY_CONFIG', {}) -# TODO: Remove in NetBox v4.7 -SENTRY_DSN = getattr(configuration, 'SENTRY_DSN', None) SENTRY_ENABLED = getattr(configuration, 'SENTRY_ENABLED', False) -# TODO: Remove in NetBox v4.7 -SENTRY_SAMPLE_RATE = getattr(configuration, 'SENTRY_SAMPLE_RATE', 1.0) -# TODO: Remove in NetBox v4.7 -SENTRY_SEND_DEFAULT_PII = getattr(configuration, 'SENTRY_SEND_DEFAULT_PII', False) SENTRY_TAGS = getattr(configuration, 'SENTRY_TAGS', {}) -# TODO: Remove in NetBox v4.7 -SENTRY_TRACES_SAMPLE_RATE = getattr(configuration, 'SENTRY_TRACES_SAMPLE_RATE', 0) SESSION_COOKIE_NAME = getattr(configuration, 'SESSION_COOKIE_NAME', 'sessionid') SESSION_COOKIE_PATH = CSRF_COOKIE_PATH SESSION_COOKIE_SECURE = getattr(configuration, 'SESSION_COOKIE_SECURE', False) @@ -637,31 +629,21 @@ MAINTENANCE_EXEMPT_PATHS = ( # Sentry # -# Warn on the presence of deprecated Sentry config parameters -for config_param in ('SENTRY_DSN', 'SENTRY_SAMPLE_RATE', 'SENTRY_SEND_DEFAULT_PII', 'SENTRY_TRACES_SAMPLE_RATE'): - if hasattr(configuration, config_param): - warnings.warn( - f"{config_param} is deprecated and will be removed in NetBox v4.7. Use SENTRY_CONFIG instead.", - DeprecationWarning, - ) - if SENTRY_ENABLED: try: import sentry_sdk except ModuleNotFoundError: raise ImproperlyConfigured("SENTRY_ENABLED is True but the sentry-sdk package is not installed.") - # Construct default Sentry initialization parameters from legacy SENTRY_* config parameters + # Build the Sentry initialization parameters sentry_config = { - 'dsn': SENTRY_DSN, - 'sample_rate': SENTRY_SAMPLE_RATE, - 'send_default_pii': SENTRY_SEND_DEFAULT_PII, - 'traces_sample_rate': SENTRY_TRACES_SAMPLE_RATE, + 'sample_rate': 1.0, + 'send_default_pii': False, + 'traces_sample_rate': 0, # TODO: Support proxy routing 'http_proxy': HTTP_PROXIES.get('http') if HTTP_PROXIES else None, 'https_proxy': HTTP_PROXIES.get('https') if HTTP_PROXIES else None, } - # Override/extend the default parameters with any provided via SENTRY_CONFIG sentry_config.update(SENTRY_CONFIG) # Check for a DSN if not sentry_config.get('dsn'):