If you are running your applications on a microservices architecture you might want to trace which instances are getting called, how often and which one may have performance issues. In this post we are going to add a distributed tracing to monitor our Quarkus application so we can easily identify which instances are being called.
In this post we will see how to log all received requests by adding Jaeger as the Distributed Tracing system of an existing Quarkus application.
First we need to add the smallrye-opentracing extension to our project by running the Quarkus add-extension command:
Hopefully, you should get a success message printed out in your terminal telling you that your extension has been installed and as usual we now need to import our new maven dependency into the project.
The next thing we need to do is configure our application properties file to set, among other things, the name of the service for the Jaeger UI in which all of our logs will be saved to.
Before running our Quarkus application, lets run Jaeger in Docker so we can test if all of our requests are being logged appropriately.
Start Quarkus and access your application endpoint so Quarkus can send logs of the request to Jaeger: To access the Jaeger UI go to: http://your-host:16686 and select the name of your service in the dropdown menu. You can also specify a different host where you have Jaeger running like this:quarkus.jaeger.endpoint=http://your-host:14268/api/tracesIf everything went well you should be able to select your service name from the Jaeger UI: In the next post we will add fault tolerance to our quarkus application!
Comments
Post a Comment