Spring Boot Actuator endpoints let you monitor and interact with your application. Spring Boot includes a number of built-in endpoints and lets you add your own. For example, the health endpoint provides basic application health information. In this tutorial we will learn how to use the HTTP Tracing Actuator Endpoint.

In order to use Spring Boot Actuator all you need to do is including its dependency in the pom.xml file:

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

By default, only the /health and /info endpoints are exposed by default. To expose the httptrace Endpoint, you need to add in your application.properties the following:

management.endpoints.web.exposure.include=httptrace

Now you can issue some requests for your application then check the actuator/httptrace endpoint:

curl http://localhost:8080/actuator/httptrace

Spring boot actuator trace http

As you can see, the response returned contains several fields:

  • timestamp: the time when the request was received
  • principal: the authenticated user who did the request, if any
  • session: the session associated with the request
  • request: information about the request such as the method, full URI or headers
  • response: information about the response such as the status or the headers
  • timeTaken: the time taken to handle the request

Besides it, the Actuator contains both the Request and the Response returned.

FREE WildFly Application Server - JBoss - Quarkus - Drools Tutorials