adminfaces / admin-starter-springboot

https://adminfaces.github.io/admin-starter
37 stars 33 forks source link

How to enabled Spring Boot Admin endpoints? #10

Open lzkill opened 4 years ago

lzkill commented 4 years ago

How can we enable Spring Boot Admin endpoints like /actuator? In the fresh project all endpoints are handled by JSF.

Thanks!

rmpestano commented 4 years ago

Hi, do you have a sample project? I think you'll need to use admin.skipResources so AdminFaces filter doesn't interfere on actuator endpoints.

See bullet 14 here: https://adminfaces.github.io/docs/1.0.0/index.html#configuration

I hope It helps

lzkill commented 4 years ago

I get a 404 when admin-config.properties has the following line:

admin.ignoredResources=/actuator,/actuator/health

How can we check if jsf is avoiding the SPA servlet to handle the request?

lzkill commented 4 years ago

Maybe you can take a look at the project: admin-faces-spring-boot

rmpestano commented 4 years ago

Hi, what do I need to do in order to make the application start? I'm getting following error at startup:

2019-11-10 07:27:45.349  INFO 29423 --- [           main] br.com.cesan.biconfig.AdminBootMain      : Started AdminBootMain in 9.233 seconds (JVM running for 9.661)
2019-11-10 07:27:45.710  WARN 29423 --- [gistrationTask1] d.c.b.a.c.r.ApplicationRegistrator       : Failed to register application as Application(name=admin-faces-spring-boot, managementUrl=http://oss-powerhouse:8080/actuator, healthUrl=http://oss-powerhouse:8080/actuator/health, serviceUrl=http://oss-powerhouse:8080/) at spring-boot-admin ([http://boot-admin:8080/instances]): I/O error on POST request for "http://boot-admin:8080/instances": boot-admin; nested exception is java.net.UnknownHostException: boot-admin. Further attempts are logged on DEBUG level

Probably I need to start actuator/admin before starting the app but can you tell me which versions and parameters are you using?

rmpestano commented 4 years ago

Looking here looks like I need a springboot admin server, do you have a sample server application to share as well?

lzkill commented 4 years ago

Spring Boot Admin can be started locally as a regular boot application (look here). The message you see it's just a warning showing that the app couldn't register itself in the Spring Boot Admin Server specified. When it does, SPA starts polling the app in the /actuator endoint, exposed by the spring-boot-admin-starter-client dependency. So, the only thing preventing the monitoring to work is a no access to /actuator.

rmpestano commented 4 years ago

I didn't had time to test yet (sorry) but what occurred to me is that we should try actuator only with JoinFaces, have you tried that? just to make sure it is a adminfaces issue.

Can you make that test? thank you!