nacos
nacos copied to clipboard
prometheus http sd support
Prometheus doesn't support Nacos service discovery, but it support generic http sd. Here's an prometheus issue track this.
Nacos already provides API to fetch list of instances of a service:
curl -X GET 'http://192.168.101.105:8848/nacos/v1/ns/instance/list?serviceName=jax&username=xxx&password=xxx'
{
"hosts":[
{
"ip":"192.168.101.105",
"port":9999,
"valid":true,
"healthy":true,
"marked":false,
"instanceId":"192.168.101.105#9999#DEFAULT#DEFAULT_GROUP@@jax",
"metadata":{
"preserved.register.source":"SPRING_CLOUD"
},
"enabled":true,
"weight":1.0,
"clusterName":"DEFAULT",
"serviceName":"jax",
"ephemeral":true
}
],
"dom":"jax",
"name":"DEFAULT_GROUP@@jax",
"cacheMillis":3000,
"lastRefTime":1656736565093,
"checksum":"aed6473823bfba043f334c46b5ef577d",
"useSpecifiedURL":false,
"clusters":"",
"env":"",
"metadata":{
}
}
Nacos need go a step ahead to adjust the output format per http sd.
We may add an plugin like istio, to support and adjust other protocol.
good idea
@i will resolve it@
refer to #1032