Skip to content

feat(relay): add settings to infer ip#4623

Merged
Litarnus merged 21 commits intomasterfrom
martinl/infer-ip-setting
Apr 11, 2025
Merged

feat(relay): add settings to infer ip#4623
Litarnus merged 21 commits intomasterfrom
martinl/infer-ip-setting

Conversation

@Litarnus
Copy link
Copy Markdown
Contributor

@Litarnus Litarnus commented Mar 27, 2025

This PR adds a settings structure in the SDK context of an event and adds the infer_ip field to give explicit control if an IP address should be inferred.

Currently 3 values are supported, one of them being used to describe legacy behavior

  • auto - equivalent to the old {{auto}}, it will infer the IP address from request information unless user.ip_address contains an actual IP address. The main difference is that it will also infer the IP if the submitted IP address is missing.
  • never - Do no derive the IP under any circumstances. If user.ip_address contains {{auto}}, it will be removed.
  • legacy - If no value is sent, then this will be the default. Uses old behaviour of inferring the IP if {{auto}} is specified and also backfills REMOTE_ADDR. It will also enable the IP inference for javascript, cocoa and objc if the submitted IP address is missing

@Litarnus Litarnus self-assigned this Mar 27, 2025
@Litarnus Litarnus marked this pull request as ready for review April 3, 2025 08:27
@Litarnus Litarnus requested a review from a team as a code owner April 3, 2025 08:27
@Litarnus Litarnus linked an issue Apr 3, 2025 that may be closed by this pull request
@cleptric cleptric self-requested a review April 3, 2025 08:38
@Litarnus Litarnus merged commit 97b9182 into master Apr 11, 2025
27 checks passed
@Litarnus Litarnus deleted the martinl/infer-ip-setting branch April 11, 2025 08:23
Litarnus added a commit to getsentry/sentry-docs that referenced this pull request May 5, 2025
This PR adds documentation for `settings` in the `sdk` context. 
This enables the SDK to control certain mechanisms without relying on "magic values" like `{{auto}}` for `ip_address`.

Currently only `infer_ip` is implemented but new fields might be introduced in the future.

See getsentry/relay#4623
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.

Do not derive {{auto}} IPs when toggle is off

3 participants