billnote commented on issue #4552:
URL: https://github.com/apache/apisix/issues/4552#issuecomment-875394437


   This line of code causes the bug.
   
[https://github.com/apache/apisix/blob/3602646ff7a46b10db58741763f413b40f8d9547/apisix/plugins/prometheus/exporter.lua#L311](url)
   
   Because etcd key has the prefix in default config. Use below code to solve 
this bug:
   ```
           local key = "/routes/"
           local local_conf = core.config.local_conf()
           if local_conf.etcd and local_conf.etcd.prefix then
               key = local_conf.etcd.prefix .. key
           end
           
           local res, _ = config:getkey(key)
   ```


-- 
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