Gary-Airwallex opened a new issue #2119:
URL: https://github.com/apache/apisix/issues/2119
### Issue description
We'd like to access ctx.matched_route.value.uri (or uris) in
prometheus.exporter.log(). It worked fine with routes like
```
# /apisix/admin/routes/1
"methods": ["GET"],
"plugins": {
"prometheus": {
}
},
"upstream": {
"nodes": {
"127.0.0.1:1980": 1
},
"type": "roundrobin"
},
"uri": "/hello"
```
But after adding
```
# /apisix/admin/services/1
"plugins": {
"prometheus": {}
},
"upstream": {
"nodes": {
"127.0.0.1:1980": 1
},
"type": "roundrobin"
}
# /apisix/admin/routes/2
"service_id": 1,
"uri": "/hello1"
```
I'm getting
```
{"value":{"service_id":"1","plugins":{"prometheus":{}},"upstream":{"hash_on":"vars","nodes":[{"host":"127.0.0.1","port":1980,"weight":1}],"type":"roundrobin"},"id":"2"},"clean_handlers":{},"createdIndex":931,"modifiedIndex":931,"has_domain":false,"key":"\/apisix\/services\/1","_cache_ver":{"value":{"plugins":{"prometheus":{}},"upstream":{"nodes":[{"host":"127.0.0.1","port":1980,"weight":1}],"hash_on":"vars","type":"roundrobin"},"id":"1"},"clean_handlers":{},"createdIndex":931,"has_domain":false,"key":"\/apisix\/services\/1","modifiedIndex":931}}
```
as ctx.matched_route in `prometheus.exporter.log` for GET /hello1. Notice
that uri is missing in value.
Any help is greatly appreciated.
### Environment
* apisix version (cmd: `apisix version`): 1.5
* OS: osx
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]