rcruzper / express-actuator

Express middleware with endpoints to help you monitor and manage applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Registration to Spring boot admin

AnthonyNTK opened this issue · comments

Any documentation on how to register the app to Spring boot admin?

Hi,

this is something that is not implemented. I didn't think in this feature but I will take it into account for the future. Even better, if you think you could help to implement it, it would be nice :)

I also needed this so just sharing some info. To register your app in Spring Boot Admin you just need to do this POST request on /instances apparently:
POST: <your spring boot admin URL>/instances
Body:

{
	"name": "my-app",
	"managementUrl": "<your actuator URL>",
	"healthUrl": ""<your actuator URL>/health",
	"serviceUrl": "<your app URL>",
	"metadata": {
		"startup": "2021-10-28T07:46:51.880214+02:00"
	}
}

This will return the Spring Boot Admin ID, f.e.

{
    "id": "b2dae23a7c61"
}

which you can use do deregister your app if needed. You do this by doing a DELETE request on /instances:
DELETE: <your spring boot admin URL>/instances/<your app ID>

As mentioned in README, to see the correct name and version of your application, specify them in your package.json

I was looking how Spring Boot deals with this register/deregister feature from Spring Boot Admin (SBA) and it looks like there is another dependency called spring-boot-admin-starter-client which is the responsible to register the app into SBA.

I have also found that python has a dependency called pyctuator which merge the actuator and SBA registration features.

Right now I think that the best way to deal with this request is to create another npm package to implement it, but I will track this issue in my backlogto give it a more deeply though