sentry-rust icon indicating copy to clipboard operation
sentry-rust copied to clipboard

sentry-actix does not send REMOTE_ADDR to the server, even though sentry::capture_error does

Open 026Fatih opened this issue 1 year ago • 0 comments
trafficstars

Environment

  • Self hosted Sentry: 23.6.2
  • sentry: 0.34.0
  • sentry-actix: 0.34.0

Steps to Reproduce

  1. Create an Actix project with sentry and sentry-actix crates
  2. Set the SENTRY_DSN environment variable.
  3. Initialise Sentry with the following configuration:
let _guard = sentry::init(sentry::ClientOptions {
        release: sentry::release_name!(),
        debug: true,
        attach_stacktrace: true,
        send_default_pii: true,
        traces_sample_rate: 1.0,
        auto_session_tracking: true,
        session_mode: sentry::SessionMode::Request,
        ..Default::default()
    });
  1. Use the sentry-actix middleware:
.wrap(sentry_actix::Sentry::with_transaction())
  1. Send a request to one of the endpoints.

Expected Result

On the server, I should be able to see the remote IP address from which the request was made in the REMOTE_ADDR field.

Actual Result

The REMOTE_ADDR field is missing in the event details on the server.

Note

If I use sentry::capture_error at step 4, the REMOTE_ADDR field can be seen on the server.

026Fatih avatar Aug 24 '24 08:08 026Fatih