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

Simplify Sentry configuration in Spring integration. #1259

Merged
merged 4 commits into from
Feb 17, 2021

Conversation

maciejwalkowiak
Copy link
Contributor

📜 Description

Auto-configures user provided callbacks and event processors on SentryOptions as well as SentryConfiguration bean.

💡 Motivation and Context

Currently there is no straightforward way to configure callbacks and event processors on SentryOptions in Spring integration. With this change, there is a convenient way to set most common callbacks just as Spring beans and if something advanced needs to be configured users can define SentryConfiguration beans that post processes SentryOptions before SentryInit is called.

💚 How did you test it?

Integration tests.

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

Update reference docs.

@codecov-io
Copy link

codecov-io commented Feb 16, 2021

Codecov Report

Merging #1259 (32b70ce) into main (9003653) will increase coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1259      +/-   ##
============================================
+ Coverage     74.91%   75.03%   +0.12%     
- Complexity     1743     1747       +4     
============================================
  Files           183      183              
  Lines          6118     6141      +23     
  Branches        609      609              
============================================
+ Hits           4583     4608      +25     
+ Misses         1256     1254       -2     
  Partials        279      279              
Impacted Files Coverage Δ Complexity Δ
.../io/sentry/spring/SentryInitBeanPostProcessor.java 97.22% <100.00%> (+2.48%) 6.00 <1.00> (+1.00)
...sentry/spring/tracing/SentryTransactionAdvice.java 87.87% <0.00%> (-2.75%) 8.00% <0.00%> (-1.00%)
sentry/src/main/java/io/sentry/IHub.java 80.00% <0.00%> (ø) 8.00% <0.00%> (ø%)
sentry/src/main/java/io/sentry/Span.java 95.45% <0.00%> (ø) 13.00% <0.00%> (ø%)
sentry/src/main/java/io/sentry/Scope.java 92.82% <0.00%> (ø) 65.00% <0.00%> (ø%)
sentry/src/main/java/io/sentry/Attachment.java 100.00% <0.00%> (ø) 12.00% <0.00%> (ø%)
...ry/src/main/java/io/sentry/TransactionContext.java 100.00% <0.00%> (ø) 7.00% <0.00%> (ø%)
sentry/src/main/java/io/sentry/SpanContext.java 97.14% <0.00%> (+0.08%) 16.00% <0.00%> (ø%)
.../io/sentry/spring/tracing/SentryTracingFilter.java 81.08% <0.00%> (+0.52%) 5.00% <0.00%> (ø%)
sentry/src/main/java/io/sentry/Sentry.java 44.02% <0.00%> (+1.28%) 19.00% <0.00%> (+1.00%)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9003653...32b70ce. Read the comment docs.

Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

LGTM.

Comment on lines +48 to +51
applicationContext
.getBeansOfType(EventProcessor.class)
.values()
.forEach(options::addEventProcessor);
Copy link
Contributor

Choose a reason for hiding this comment

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

what's about doing the same for List<Integration> integrations?

@maciejwalkowiak maciejwalkowiak merged commit 137d4f5 into main Feb 17, 2021
@maciejwalkowiak maciejwalkowiak deleted the spring-config-options branch February 17, 2021 14:00
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.

4 participants