Skip to content

feat: add sdkOptions passthrough for Sentry SDK client options - #52

Open
gradinarufelix wants to merge 1 commit into
flownative:mainfrom
gradinarufelix:feature-sdk-options
Open

feat: add sdkOptions passthrough for Sentry SDK client options#52
gradinarufelix wants to merge 1 commit into
flownative:mainfrom
gradinarufelix:feature-sdk-options

Conversation

@gradinarufelix

Copy link
Copy Markdown
Contributor

Adds a Flownative.Sentry.sdkOptions settings map whose entries are passed to \Sentry\init(), so projects can configure any YAML-representable SDK option (e.g. max_request_body_size, send_default_pii) without a package change.

Flownative:
  Sentry:
    sdkOptions:
      max_request_body_size: 'never'
      send_default_pii: false
  • Options the package sets explicitly always take precedence (array_replace($sdkOptions, $typedOptions)), so existing settings like sampleRate cannot be silently overridden.
  • before_send, before_send_transaction, before_send_check_in, before_send_log, before_send_metrics, ignore_exceptions and integrations are reserved and rejected at boot with an exception naming the offending settings path — they are managed by the package (and callables cannot be expressed in YAML anyway).
  • in_app_exclude entries are merged with the package defaults instead of replacing them.
  • Empty by default: unconfigured behavior is byte-for-byte unchanged.

Which options are valid depends on the installed sentry/sentry version; the README documents this.

Background: we roll out Sentry to privacy-sensitive customers and need max_request_body_size: 'never' (form submissions must not be attached to events) configurable per project without forking.

Flownative.Sentry.sdkOptions lets projects configure any YAML-representable
Sentry SDK option (e.g. max_request_body_size, send_default_pii) without a
package change. Options set explicitly by this package always win; the
before_send* callbacks, ignore_exceptions and integrations are reserved and
rejected at boot with the offending settings path; in_app_exclude entries
are merged with the package defaults.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant