Posts

Showing posts with the label Docker

Monitoring Spring Boot Application with Prometheus and Grafana

Image
 Every application that is deployed on production needs some kind of monitoring to see how the application is performing. This will give you some insights on whether the application is performing as aspected or if you would need to take some action in order to obtain the desired level of performance. In the modern world, this data is called Application Performance Metrics (APM).   Let’s try to set up a basic Springboot App monitoring with a Grafana Dashboard and Prometheus.

Creating Efficient Docker Images with Spring Boot 2.3

Image
Spring Boot 2.3 brings with it some interesting new features that can help you package up your Spring Boot application into Docker images. The first problem with common docker techniques is that the jar file is not unpacked. There’s always a certain amount of overhead when running a fat jar, and in a containerized environment this can be noticeable. It’s generally best to unpack your jar and run in an exploded form. The second issue with the file is that it isn’t very efficient if you frequently update your application. Docker images are built in layers, and in this case your application and all its dependencies are put into a single layer. Since you probably recompile your code more often than you upgrade the version of Spring Boot you use, it’s often better to separate things a bit more. If you put jar files in the layer before your application classes, Docker often only needs to change the very bottom layer and can pick others up from its cache. Two new features are introduced in Sp...

Docker for Java development

Image
The promise to use Docker during development is to provide a consistent test environment on your development machines and the different environments you use (such as QA and manufacturing). The last thing you want to do is slow your development cycle. Even if you or your team are not involved in using Docker on development computers as part of this process, there are several use cases for modifying and debugging code running in the container. For example, a developer can use Docker to mimic the production environment to reproduce errors or other conditions. In addition, the ability to debug remotely on a docked host can enable practical troubleshooting of a running environment such as QA. Let us take as an example a simple application that emulates the console's password change utility. The program asks for the login and the current password. After verifying the credentials, it prompts you to enter your new password twice. If the passwords do not match, it asks for a new password ag...