Skip to content

SentryUserProvider for Spring WebFlux #2686

Answered by adinauer
sleep-dev asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @sleep-dev, unfortunately SentryUserProvider is only for Spring WebMVC.

You could add a custom EventProcessor or use beforeSend to set user info before an event is sent to Sentry.

Alternatively you should also be able to modify the current Scope and add the User using aWebFilter. You just need to make sure you set the right order so it goes after SentryWebTracingFilter. You may need to retrieve the current Hub from ServerWebExchange (exchange.getAttributes().getOrDefault(SENTRY_HUB_KEY, null);) depending on your version of Spring (Boot) and availability of ThreadLocalAccessor. You may find this comment helpful.

Does that help?

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@sleep-dev
Comment options

@sleep-dev
Comment options

@adinauer
Comment options

@sleep-dev
Comment options

Answer selected by sleep-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants