Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not register sentrySpringFilter in ServletContext for Spring Boot #3027

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Nov 6, 2023

📜 Description

In Spring Boot 3.1.x our SentrySpringServletContainerInitializer is executed before Spring registers filters and Spring Boot now throws an exception if the filter has already been registered. We now check if the app is running as Spring Boot and skip registering the filter ourselves in that case.

💡 Motivation and Context

Fixes #3019

💚 How did you test it?

Manually using dockerized tomcat.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Nov 6, 2023

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 560a80c

Copy link
Contributor

github-actions bot commented Nov 6, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 396.42 ms 460.00 ms 63.58 ms
Size 1.72 MiB 2.29 MiB 577.53 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0bf143e 368.35 ms 437.47 ms 69.12 ms
3d8bd2b 364.76 ms 469.98 ms 105.22 ms
bc4be3b 360.40 ms 435.04 ms 74.64 ms
93a76ca 377.41 ms 448.22 ms 70.81 ms
86f0096 371.86 ms 439.78 ms 67.92 ms
c7e2fbc 398.35 ms 468.52 ms 70.17 ms
93a76ca 381.08 ms 459.22 ms 78.14 ms
93a76ca 391.54 ms 475.65 ms 84.11 ms
7ca9895 364.31 ms 460.46 ms 96.15 ms
0404ea3 332.47 ms 401.12 ms 68.66 ms

App size

Revision Plain With Sentry Diff
0bf143e 1.72 MiB 2.29 MiB 576.50 KiB
3d8bd2b 1.72 MiB 2.29 MiB 577.53 KiB
bc4be3b 1.72 MiB 2.29 MiB 576.53 KiB
93a76ca 1.72 MiB 2.29 MiB 576.75 KiB
86f0096 1.72 MiB 2.29 MiB 576.50 KiB
c7e2fbc 1.72 MiB 2.29 MiB 576.40 KiB
93a76ca 1.72 MiB 2.29 MiB 576.75 KiB
93a76ca 1.72 MiB 2.29 MiB 576.75 KiB
7ca9895 1.72 MiB 2.29 MiB 576.51 KiB
0404ea3 1.72 MiB 2.29 MiB 577.52 KiB

Copy link
Collaborator

@lbloder lbloder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@adinauer adinauer enabled auto-merge (squash) November 6, 2023 15:52
Copy link

codecov bot commented Nov 6, 2023

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Files Coverage Δ
...karta/SentrySpringServletContainerInitializer.java 0.00% <0.00%> (ø)

📢 Thoughts on this report? Let us know!.

@adinauer adinauer merged commit 2fad834 into main Nov 6, 2023
24 of 26 checks passed
@adinauer adinauer deleted the feat/spring-boot-tomcat-fix branch November 6, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to register sentrySpringFilter using Spring Boot 3 and Tomcat 10.1.15
2 participants