Record User Information

Record user information from an HTTP request or by registering a Spring bean for custom user information capture.

Recording User Information From HTTP Request

To record the user's IP address and Principal#name as the username, set the personal information flag to true.


Recording Custom User Information

To record custom user information, you can register a bean that implements SentryUserProvider interface.

import org.springframework.stereotype.Component;
import io.sentry.protocol.User;
import io.sentry.spring.SentryUserProvider;

class CustomSentryUserProvider implements SentryUserProvider {
  public User provideUser() {
    User user = new User();
    // ... set user information
    return user
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").
Suggest an edit to this page   |  Contribute to Docs   |  

Report a Problem

🎉 Thank you for your feedback! 🙌
Report a problem