Introduce a SENTRY_CONFIG parameter to extend and ultimately replace individual Sentry config parameters #11628

Closed
opened 2025-12-29 21:47:50 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Sep 17, 2025).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v4.4.1

Feature type

Change to existing functionality

Proposed functionality

Introduce a new config parameter named SENTRY_CONFIG. This will define a dictionary of arguments to pass to sentry_sdk.init() when the application is initialized.

Eventually, this parameter is expected to replace the following existing parameters; however, backward compatibility will be retained for now.

  • SENTRY_DSN
  • SENTRY_SAMPLE_RATE
  • SENTRY_SEND_DEFAULT_PII
  • SENTRY_TRACES_SAMPLE_RATE

Example usage:

SENTRY_CONFIG = {
    "dsn": "https://examplePublicKey@o0.ingest.sentry.io/0",
    "send_default_pii": True,
    "before_send_transaction": strip_sensitive_data,
}

Use case

This approach enables NetBox administrators to pass additional Sentry initialization arguments for which a NetBox configuration parameter does not exist.

Database changes

N/A

External dependencies

N/A

Originally created by @jeremystretch on GitHub (Sep 17, 2025). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v4.4.1 ### Feature type Change to existing functionality ### Proposed functionality Introduce a new config parameter named `SENTRY_CONFIG`. This will define a dictionary of arguments to pass to [`sentry_sdk.init()`](https://docs.sentry.io/platforms/python/#configure) when the application is initialized. Eventually, this parameter is expected to replace the following existing parameters; however, backward compatibility will be retained for now. * `SENTRY_DSN` * `SENTRY_SAMPLE_RATE` * `SENTRY_SEND_DEFAULT_PII` * `SENTRY_TRACES_SAMPLE_RATE` Example usage: ```python SENTRY_CONFIG = { "dsn": "https://examplePublicKey@o0.ingest.sentry.io/0", "send_default_pii": True, "before_send_transaction": strip_sensitive_data, } ``` ### Use case This approach enables NetBox administrators to pass additional Sentry initialization arguments for which a NetBox configuration parameter does not exist. ### Database changes N/A ### External dependencies N/A
adam added the status: acceptedtype: featurecomplexity: low labels 2025-12-29 21:47:50 +01:00
adam closed this issue 2025-12-29 21:47:50 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11628