Skip to content

Software Engineering Blog

Say Goodbye to meaningless code for Controller and Service with Spring-Data-Rest

cover.png

In this article, we will introduce a convenient library, Spring-Data-Rest to eliminate your meaningless code in a Spring Boot Application. As we all know, a DB-access API will be implemented as a Controller-Service-Repository stack in a Spring Boot application coding convention. Often, there is no business logic in controllers and services, but only call the next component and return the result. It’s exactly the meaningless code. The Spring-Data-Rest can help us to eliminate it elegantly.

Spring Boot 3 Observability: monitor Application on the method level

Observe using ObservedAspect with logging method arguments

cover.png

Observability is one of the significant improvements in the Spring Boot 3 (also see how I migrate to spring boot 3), they now provide an effortless, pluggable way to use annotation to observe all the logs, trace, and metrics data for our spring beans.

In this article, we will go through below topics:

  • Recap on how observability works
  • Run monitoring component (Grafana, Loki, Tempo, Prometheus) by docker-compose
  • How to implement code to observe the Application
  • How to log method arguments in ObservedAspect
  • How would data be displayed on the Grafana