spacewander commented on a change in pull request #4561:
URL: https://github.com/apache/apisix/pull/4561#discussion_r666137101



##########
File path: apisix/core/config_etcd.lua
##########
@@ -71,6 +71,11 @@ local function getkey(etcd_cli, key)
         return nil, "not inited"
     end
 
+    local local_conf, _ = config_local.local_conf()

Review comment:
       ```suggestion
       local local_conf = config_local.local_conf()
   ```

##########
File path: apisix/plugins/prometheus/exporter.lua
##########
@@ -308,7 +308,7 @@ function _M.collect()
                            "processing metrics endpoint: ", err)
         end
 
-        local res, _ = config:getkey("/routes")
+        local res, _ = config:getkey("/routes/")

Review comment:
       Let's change the key name.

##########
File path: apisix/core/config_etcd.lua
##########
@@ -71,6 +71,11 @@ local function getkey(etcd_cli, key)
         return nil, "not inited"
     end
 
+    local local_conf, _ = config_local.local_conf()
+    if local_conf and local_conf.etcd and local_conf.etcd.prefix then
+        key = local_conf.etcd.prefix .. key
+    end

Review comment:
       Should be added to _M.getkey?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to