Skip to main content

[Ruby] Why am I missing the "X-Forwarded-For" header in my events?

Issue

I use the Ruby SDK, and my Sentry events are missing certain request headers, such as X-Forwarded-For, even though the headers exist when the event is sent. I want to capture the client IP address and forwarded headers.

Applies To

  • Ruby SDK users

Resolution

Sentry does not send the X-Forwarded-For header with events by default, because it is considered personally identifiable information (PII).

To include it, enable send_default_pii in your SDK initialization:

config.send_default_pii = true

For more on the data Sentry collects and how PII is handled, see the configuration options documentation.

Did this answer your question?