Exporting spring boot metrics to cloudwatch may not be that straightforward. Since I’ve done that for my project, I will show how we can do it easily with the help of a couple of libraries. First, spring boot is using its own metrics mechanism. The first step to do that is to swap it with dropwizard’s metrics library which is more powerful and has more feature. Thankfully, the actuator has complete support for the library from what it’s written in the documentation.
This is the first time I’m deploying stuff to elasticbeanstalk, and when I’m trying to deploy my private project, I realized the eb cli I download is the version 2 and has different syntax. I installed the version 3, and it seems like it can only be installed using python package manager pip. After installing it, this is what I get: rowanto@Rowanto-Deb ~ $ eb Traceback (most recent call last): File "/usr/local/bin/eb", line 9, in <module> load_entry_point('awsebcli==3.