0
votes

I'm trying to enable custom endpoint for a project that's inside other project.

I have a parent project with its pom.xml, then inside that project I have zuul-gateway project which has its own pom.xml with the parent set to parent project.

I do everything correctly in terms of enabling custom endpoint because I've tried the solution on a standalone project (no child-parent relationship) and it works, but when I try to use it in a child project the endpoint gets ignored.

web:
  exposure:
    include: info, health, metrics, microservices-health

The three metrics before (info, health, metrics) my custom one (microservices-health) get mapped correctly to actuator, while my custom one gets completely ignored.

EDIT: the spring boot version used is 2.0.x

1
what do you mean by child project? You have to configure on the app level. If you include another JAR this configuration is not loadedSimon Martinelli
link Here is the picture of the project structure. Im trying to configure custom endpoint in the actuator directory of a 'zuul-gateway' project.Marin
That will not work.You have to configure that on the project that contains @SpringBootApplication and the main classSimon Martinelli
I've fixed it. The problem was that the starting class was inside the /boot directory and the component scan didn't scan anything inside /actuator directory then. When I moved ZuulApp a level above, it mapped correctly. Hope I make any sense...Marin
Yes perfect. I suggest that you add this as the answer of your question.Simon Martinelli

1 Answers

0
votes

I've fixed it. The problem was that the starting class was inside the /boot directory and the component scan didn't scan anything inside /actuator directory then. When I moved ZuulApp (starting class) a level above, it mapped correctly.