ENTERPRISE PLUS: What are some useful router health check APIs for JFrog Platform products?

Matthew Wang
2023-01-22 11:05

There are some useful APIs you can run against the JFrog Router. If you want to see the health status of all microservices, you can run:

curl -shttp://localhost:8082/router/api/v1/system/health

The above api will show:

Healthy Response:
200 OK
Content-Type: application/json
{
"router": {
"node_id": "dsf76s-f87df86sdf-kjhsdg329",
"state": "HEALTHY",
"message": "OK"
},
"services": [
{
"service_id": "jfsvc@123",
"node_id": "dsf76s-f87df86sdf-kjhsdg329",
"state": "HEALTHY",
"message": "OK"
},
...
]
}

There is also a system ping API:

curl -s http://localhost:8082/router/api/v1/system/ping

Response:
OK 200 / Service Unavailable 503

If you want to check the status of the microservices of all products in the platform, you can run the below (must be against localhost port 8046):

curl -s http://localhost:8046/router/api/v1/topology/health | jq

{
"nodes": {
"http://10.128.0.51:8082": {
"service_registry_state": "HEALTHY",
"last_heartbeat": 1631303251664,
"effective_state": "HEALTHY",
"health_response": {
"router": {
"message": "OK",
"node_id": "test-arti-unified",
"state": "HEALTHY"
},
"services": [
{
"message": "OK",
"node_id": "test-arti-unified",
"service_id": "jfac@01c2jcb06rqw0w0j7p93xj19g8",
"state": "HEALTHY"
},
{
"message": "OK",
"node_id": "test-arti-unified",
"service_id": "jfevt@01c2jcb06rqw0w0j7p93xj19g8",
"state": "HEALTHY"
},
{
"message": "OK",
"node_id": "test-arti-unified",
"service_id": "jffe@000",
"state": "HEALTHY"
},
{
"message": "OK",
"node_id": "test-arti-unified",
"service_id": "jfmd@01e4a9wqe59amqtnvd7jgysb2f",
"state": "HEALTHY"
},
{
"message": "OK",
"node_id": "test-arti-unified",
"service_id": "jfrt@01c2jcbmcp8f2b0qfpw9c8021z",
"state": "HEALTHY"
}
]
}
},
"http://10.128.0.51:8083": {
"service_registry_state": "HEALTHY",
"last_heartbeat": 1631303253016,
"effective_state": "HEALTHY",
"health_response": {
"router": {
"message": "OK",
"node_id": "test-xray",
"state": "HEALTHY"
},
"services": [
{
"message": "OK",
"node_id": "test-xray",
"service_id": "jfxana@01e4d0gfnhrd5sbx9jxv4phw83",
"state": "HEALTHY"
},
{
"message": "OK",
"node_id": "test-xray",
"service_id": "jfxidx@01e4d0gfne22g14vjcv2hyryj7",
"state": "HEALTHY"
},
{
"message": "OK",
"node_id": "test-xray",
"service_id": "jfxpst@01e4d0gfnhp9bqjhqtk07837xn",
"state": "HEALTHY"
},
{
"message": "OK",
"node_id": "test-xray",
"service_id": "jfxr@01cesj8cb47pffmh3bg00hxb6j",
"state": "HEALTHY"
}
]
}
},
"http://10.128.0.51:8084": {
"service_registry_state": "HEALTHY",
"last_heartbeat": 1631303251976,
"effective_state": "HEALTHY",
"health_response": {
"router": {
"message": "OK",
"node_id": "test-jfmc",
"state": "HEALTHY"
},
"services": [
{
"message": "OK",
"node_id": "test-jfmc",
"service_id": "jfisc@01e4eqhwqptx881h0st5bm078k",
"state": "HEALTHY"
},
{
"message": "OK",
"node_id": "test-jfmc",
"service_id": "jfisv@01efn18zhx3awv1knpqgnw07xy",
"state": "HEALTHY"
},
{
"message": "OK",
"node_id": "test-jfmc",
"service_id": "jfmc@01e4eqhatbr80e1rg1ag9p0s0w",
"state": "HEALTHY"
}
]
}
},
"http://10.128.0.51:8088": {
"service_registry_state": "HEALTHY",
"last_heartbeat": 1631303252261,
"effective_state": "HEALTHY",
"health_response": {
"router": {
"message": "OK",
"node_id": "test-dist",
"state": "HEALTHY"
},
"services": [
{
"message": "OK",
"node_id": "test-dist",
"service_id": "jfds@01e4w0vwy2z8e817mgth1817w4",
"state": "HEALTHY"
}
]
}
}
}
}