jagerzhang opened a new issue #6169:
URL: https://github.com/apache/apisix/issues/6169
### Issue description
当路由采用和service组合方式来配置时,路由属性里面的自定义标签会丢失,日志插件无法记录到自定义的标签。
### Environment
- apisix version (cmd: `apisix version`): 2.11.0
- OS (cmd: `uname -a`): docker-centos
### Steps to reproduce
1.新增upstream如下:
```
PUT /apisix/admin/upstreams/demo
{
"nodes": [
{
"host": "127.0.0.1",
"port": 9090
}
],
"scheme": "http",
"name": "demo"
}
```
2.新增service如下:
```
PUT /apisix/admin/services/demo
{
"name": "demo",
"upstream_id": "demo"
}
```
3.新增route如下:
```
PUT /apisix/admin/route/demo
{
"uris": [
"/demo"
],
"name": "demo",
"methods": [
"GET",
"POST",
"HEAD"
],
"service_id": "demo",
"labels": {
"app_name": "app_demo",
"system_name": "system_demo"
},
"status": 1
}
```
4.在requests-id插件里面新增日志阶段函数,内容如下:
```
function _M.log(conf, ctx)
core.log.warn("ctx.matched_route.value: ",
core.json.delay_encode(ctx.matched_route.value))
end
```
5.重载APISIX,请求该路由,查看日志,会发现`ctx.matched_route.value`打印的内容里面没有label相关内容.
6. 如果是使用 route直接关联 upstream的方式来添加路由,`ctx.matched_route.value`
里面会有label内容,应该是 route 和 service 的 配置 merge 的时候漏了.
### Actual result
null
### Error log
null
### Expected result
_No response_
--
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]