javaspringspring-bootspring-webfluxspring-boot-actuator

Spring Webflux 2.4.2 - 404 on actuator /auditevents /httptrace /integrationgraph /sessions endpoints


Small question regarding some actuator endpoints returning 404 please. I have a web app, based on Webflux 2.4.2, and for testing this issue only, I am using

management.endpoints.web.exposure.include=*

Actuator is working, because a curl will get the response for /health /metrics and other endpoints.

However, for those endpoints /auditevents /httptrace /integrationgraph /sessions, I am not able to get anything, besides a http 404.

[05/Feb/2021:13:00:18 +0000] "OPTIONS /auditevents HTTP/1.1" 404 141 55 ms

Those are really the only endpoints returning 404, still do not know why. Don't want to spam with one question same question per endpoint. All other actuator endpoints are fine.

Thank you


Solution

  • According to Spring Boot Reference Docs :

    To enable /httptrace in the actuator, you have to create a bean of InMemoryHttpTraceRepository class in the custom @Configuration class which provides the trace of the request and response.

    @Bean
    public HttpTraceRepository htttpTraceRepository() {
      return new InMemoryHttpTraceRepository();
    }
    

    To enable /auditevents in the actuator, you have to create a bean of InMemoryAuditEventRepository class in the custom @Configuration class which exposes audit events information.

    @Bean
    public AuditEventRepository auditEventRepository() {
      return new InMemoryAuditEventRepository();
    }
    

    To enable /integrationgraph in actuator, you have to add spring-integration-core dependency in the pom.xml (as per documentation) :

    <dependency>
        <groupId>org.springframework.integration</groupId>
        <artifactId>spring-integration-core</artifactId>
    </dependency>
    

    or if you are having a spring-boot project, then add this :

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

    /actuator/sessions are by-default enabled. But still you can add this explicitly to check the behaviour.

    Add this in application.properties.

    management.endpoint.sessions.enabled = true