Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Troubleshooting Spring Boot Applications with Sentry

Troubleshooting Spring Boot Applications with Sentry

No matter how clean our code is, how good our tests are, how well our infrastructure scales - one day, eventually something will go wrong in production. Bugs and outages cases customer to lose trust and cost real money. Our job is to identify and fix the issue as quickly as possible. In this session, we will have a look at Sentry - an open source troubleshooting and application monitoring solution - and its seamless integration with Spring Boot. We will learn the benefits of treating errors as contextual events and how exception reporting and performance monitoring in a single tool simplify addressing production issues.

Talk given at JavaCRO 2021 https://2021.javacro.hr/eng/Program/Troubleshooting-Spring-Boot-applications-with-Sentry

Code: https://github.com/maciejwalkowiak/troubleshooting-spring-boot-appplications-with-sentry

2da55e1342d18933f0bcaf804a02f200?s=128

Maciej Walkowiak

October 11, 2021
Tweet

More Decks by Maciej Walkowiak

Other Decks in Programming

Transcript

  1. MACIEJWALKOWIAK TROUBLESHOOTING SPRING BOOT APPS WITH SENTRY MACIEJ WALKOWIAK

  2. @maciejwalkowiak MAKING SOFTWARE IN 2021 LIKE A PRO •Agile •Unit

    & Integration Tests •Frequent Releases •Cloud •Deployment Automation
  3. @maciejwalkowiak DEVELOPER LIFE IN 2007 •Agile Waterfall •Unit & Integration

    Tests Manual Testing •Frequent Releases Release every few months •Cloud Server Room behind the wall •Deployment Automation Sending ZIP file to release manager
  4. @maciejwalkowiak If something can go wrong, It will go wrong

  5. MACIEJWALKOWIAK

  6. MACIEJWALKOWIAK return paymentService.executePayment(userId, payment);

  7. MACIEJWALKOWIAK try { return paymentService.executePayment(userId, payment); } catch (Exception e)

    { LOGGER.error("Executing payment failed for user: {}, payment: {}", e); throw new RuntimeException(e); }
  8. MACIEJWALKOWIAK try { LOGGER.info("Executing payment for user: {}", userId); PaymentResult

    result = paymentService.executePayment(userId, payment); LOGGER.info("Payment result: {}", result); return result; } catch (Exception e) { LOGGER.error("Executing payment failed for user: {}, payment: {}", e); throw new RuntimeException(e); }
  9. @maciejwalkowiak THINGS HAVE CHANGED •(Misunderstood) Agile •Cloud & Microservices •Mobile

    (traffic!) •(Proper) security
  10. MACIEJWALKOWIAK

  11. @maciejwalkowiak hey I just met you and this is crazy

    but can this error log be a bug report maybe?
  12. MACIEJWALKOWIAK

  13. MACIEJWALKOWIAK MACIEJ WALKOWIAK - independent consultant - Spring Cloud AWS

    Lead - working with
  14. @maciejwalkowiak DEMO TIME!

  15. @maciejwalkowiak SENTRY & SPRING BOOT INTEGRATIONS •Spring MVC •Spring WebFlux

    (error reporting) •Retrieving user information from Spring Security •RestTemplate •WebClient •Logback •declarative tracing with @SentrySpan & @SentryTransaction
  16. @maciejwalkowiak OTHER INTEGRATIONS •OpenFeign •Apollo GraphQL •Java Util Logging •Log4j2

    •Servlets
  17. MACIEJWALKOWIAK https://sentry.io

  18. MACIEJWALKOWIAK https://github.com/getsentry

  19. MACIEJWALKOWIAK https://docs.sentry.io

  20. MACIEJWALKOWIAK https://github.com/getsentry/sentry-java

  21. @maciejwalkowiak THANK YOU! HAPPY BUGFIXING!