feat(relay): add settings to infer ip#4623
Merged
Conversation
Dav1dde
approved these changes
Apr 3, 2025
cleptric
reviewed
Apr 10, 2025
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
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a
settingsstructure in the SDK context of an event and adds theinfer_ipfield 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 unlessuser.ip_addresscontains 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. Ifuser.ip_addresscontains{{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 backfillsREMOTE_ADDR. It will also enable the IP inference forjavascript,cocoaandobjcif the submitted IP address is missing