Trace http requests with Spring Actuator

List the last http request with ease

Spring Actuator provides also a httptrace endpoint. You get the last HTTP request with /httptrace.

After adding Spring Boot Actuator dependencies to your project dependencies, you have to expose the httptrace endpoint via your


curl | jq
    "traces": [{
        "timestamp": "2019-01-05T07:45:14.406Z",
        "principal": null,
        "session": null,
        "request": {
            "method": "GET",
            "uri": "",
            "headers": {
                    "host": [""],
                    "accept": ["*/*"],
                    "user-agent": ["curl/7.58.0"]
            "remoteAddress": null
        "response": {
            "status": 200,
            "headers": {
                    "Content-Length": ["16"],
                    "Date": ["Sat, 05 Jan 2019 07:45:14 GMT"],
                    "Content-Type": ["text/plain;charset=UTF-8"]
        "timeTaken": 7

In Spring Boot 2.0 the trace endpoint was renamed to httptrace. You can even configure the trace details (see code).
Here is an example

management.httptrace.include = parameter

Here is the source code of my sample application 🙂


List of Spring Actuator endpoints
List of Spring application properties