nacos icon indicating copy to clipboard operation
nacos copied to clipboard

prometheus http sd support

Open yuzhichang opened this issue 2 years ago • 3 comments

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.

yuzhichang avatar Jul 06 '22 07:07 yuzhichang

We may add an plugin like istio, to support and adjust other protocol.

KomachiSion avatar Jul 07 '22 02:07 KomachiSion

good idea

hujun-w-2 avatar Jul 09 '22 05:07 hujun-w-2

@i will resolve it@

karsonto avatar Sep 08 '22 02:09 karsonto

refer to #1032

KomachiSion avatar Sep 22 '22 06:09 KomachiSion