We are planning to host a bunch of Prometheus metrics(with different endpoints) with the same port, the metric server endpoints will be like:
- http://localhost:9090/ServiceCategory1/SubService01/
- http://localhost:9090/ServiceCategory1/SubService02/
- http://localhost:9090/ServiceCategory2/SubService01/
- http://localhost:9090/ServiceCategory2/SubService02/
My current API registration payload will ignore the port but put the whole metric service endpoint to Address field like the following
{
"ID": "ServiceId0001",
"Name": "ServiceName",
"Tags": [
"primary",
"v1"
],
"Address": "http://localhost:9090/ServiceCategory1/SubService01",
"Meta": {
"service_version": "4.0"
},
"Check": {
"name": "Ping check",
"DeregisterCriticalServiceAfter": "1m",
"Interval": "10s",
"Timeout": "5s",
"HTTP": "http://localhost:9090/ServiceCategory1/SubService01"
}
}
The address shown in Consul will be like:
it’s not quite right but can be working with Prometheus by re-labeling tweak, however, the HTTP check didn’t work of course
Not sure if anyone here can show me the correct way to achieve this or this is not achievable?