Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

"/actuator/wavefront" does not work with Spring Reactive Web #121

Open
yogendra opened this issue Jun 24, 2021 · 6 comments
Open

"/actuator/wavefront" does not work with Spring Reactive Web #121

yogendra opened this issue Jun 24, 2021 · 6 comments

Comments

@yogendra
Copy link

yogendra commented Jun 24, 2021

Wavefront dashboard url redirection does not work on Spring Reactive Web project.

I created 2 projects (see links below) and added management.endpoints.web.exposure.include=health,info,wavefront to application.propoerties on both project. On accessting /actuator/wavefront location, on reactive web project, I am not redirected to Wavefront dashboard.

Reactive Web Project Starter:
https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.5.1.RELEASE&packaging=jar&jvmVersion=11&groupId=com.example&artifactId=catalog&name=catalog&description=Spring%20Boot%20Metrics%20and%20Tracing%20%2F%2F%20Catalog%20Service&packageName=com.example.catalog&dependencies=actuator,lombok,cloud-starter-sleuth,wavefront,devtools,webflux

Web Starter Project:
https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.5.1.RELEASE&packaging=jar&jvmVersion=11&groupId=com.example&artifactId=catalogweb&name=catalogweb&description=Spring%20Boot%20Metrics%20and%20Tracing%20%2F%2F%20Catalog%20Service&packageName=com.example.catalogweb&dependencies=actuator,lombok,cloud-starter-sleuth,wavefront,devtools,web

@snicoll
Copy link
Collaborator

snicoll commented Jun 24, 2021

@yogendra thanks for the report, I've reproduced a problem where with WebFlux I get a 404 instead of the redirection:

2021-06-24 06:46:16.005 DEBUG 14211 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter    : [44365fdb-1, L:/127.0.0.1:8080 - R:/127.0.0.1:57614] HTTP GET "/actuator/wavefront"
2021-06-24 06:46:16.043 DEBUG 14211 --- [ctor-http-nio-2] o.s.w.r.handler.SimpleUrlHandlerMapping  : [44365fdb-1, L:/127.0.0.1:8080 - R:/127.0.0.1:57614] Mapped to ResourceWebHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"]
2021-06-24 06:46:16.047 DEBUG 14211 --- [ctor-http-nio-2] o.s.w.r.resource.ResourceWebHandler      : [44365fdb-1, L:/127.0.0.1:8080 - R:/127.0.0.1:57614] Resource not found
2021-06-24 06:46:16.096 DEBUG 14211 --- [ctor-http-nio-2] a.w.r.e.AbstractErrorWebExceptionHandler : [44365fdb-1, L:/127.0.0.1:8080 - R:/127.0.0.1:57614] Resolved [ResponseStatusException: 404 NOT_FOUND] for HTTP GET /actuator/wavefront
2021-06-24 06:46:16.110 DEBUG 14211 --- [ctor-http-nio-2] o.s.core.codec.CharSequenceEncoder       : [44365fdb-1, L:/127.0.0.1:8080 - R:/127.0.0.1:57614] Writing "<html><body><h1>Whitelabel Error Page</h1><p>This application has no configured error view, so you  (truncated)...
2021-06-24 06:46:16.153 DEBUG 14211 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter    : [44365fdb-1, L:/127.0.0.1:8080 - R:/127.0.0.1:57614] Completed 404 NOT_FOUND

I suspect a bug outside of this project so I'll experiment a bit more and report when I know more. Thanks again.

@yogendra
Copy link
Author

Yeah. I suspect need to put GetMapping annotation on the url.

Thanks for responding

@snicoll
Copy link
Collaborator

snicoll commented Jun 28, 2021

The infrastructure relies on RestTemplate and backs off if that's not present. In a WebFlux app, a WebClient is provided so we'll have to adapt our arrangement to support both or rely on something common. I'll give it some more thoughts.

@yogendra
Copy link
Author

I was trying to understand the code myself. Then I looked at the actuator project for reference. Perhaps a conditional configuration will be better. So we can setup one or the other.

@linghengqian
Copy link

This doesn't actually affect the use of Spring Reactive Web, right?

@snicoll
Copy link
Collaborator

snicoll commented Apr 27, 2022

No.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants