From 84e03df031eccb7dce8639445024688b068affee Mon Sep 17 00:00:00 2001 From: yutao04 Date: Tue, 3 Jan 2023 11:17:05 +0800 Subject: [PATCH] fix/to: fix virtualServiceMeta.ftl t_virtual_service_stats --- .../gateway/api/virtualServiceMeta.ftl | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/hango-api-plane-server/src/main/resources/template/gateway/api/virtualServiceMeta.ftl b/hango-api-plane-server/src/main/resources/template/gateway/api/virtualServiceMeta.ftl index 4695bbbf..59cf972a 100644 --- a/hango-api-plane-server/src/main/resources/template/gateway/api/virtualServiceMeta.ftl +++ b/hango-api-plane-server/src/main/resources/template/gateway/api/virtualServiceMeta.ftl @@ -23,10 +23,12 @@ metadata: <#if t_virtual_service_stats?has_content> - proxy.filters.http.detailed_stats: - stats: - <#list t_virtual_service_stats as stats_meta> - - ${stats_meta} + proxy.metadata_stats.detailed_stats: + stat_prefix: detailed_route + stat_tags: + <#list t_virtual_service_stats?keys as tagKey> + - key: "${tagKey}" + val: "${t_virtual_service_stats[tagKey]}" @@ -36,16 +38,16 @@ metadata: resp_exception_code: ${t_virtual_service_resp_exception_code} context: - service: ${t_virtual_service_dubbo_meta_service} - version: ${t_virtual_service_dubbo_meta_version} - method: ${t_virtual_service_dubbo_meta_method} - group: ${t_virtual_service_dubbo_meta_group} + service: "${t_virtual_service_dubbo_meta_service?j_string}" + version: "${t_virtual_service_dubbo_meta_version?j_string}" + method: "${t_virtual_service_dubbo_meta_method?j_string}" + group: "${t_virtual_service_dubbo_meta_group?j_string}" source: ${(t_virtual_service_dubbo_meta_source=="body")?string('HTTP_BODY','HTTP_QUERY')} <#if t_virtual_service_dubbo_meta_params?has_content> parameters: <#list t_virtual_service_dubbo_meta_params as p> - - type: ${p.value} - name: ${p.key} + - type: "${p.value?j_string}" + name: "${p.key?j_string}" required: ${p.required?c} <#if p.defaultValue ??> default: '${p.defaultJsonValue}' @@ -53,8 +55,8 @@ metadata: <#if p.genericMap?has_content> generic: <#list p.genericMap as k,v> - - path: ${k} - type: ${v} + - path: "${k?j_string}" + type: "${v?j_string}" @@ -62,11 +64,11 @@ metadata: <#if t_virtual_service_dubbo_meta_attachments?has_content> attachments: <#list t_virtual_service_dubbo_meta_attachments as a> - - name: ${a.serverParamName} + - name: "${a.serverParamName?j_string}" <#if a.paramPosition == "Header"> - header: ${a.clientParamName} + header: "${a.clientParamName?j_string}" <#elseif a.paramPosition == "Cookie"> - cookie: ${a.clientParamName} + cookie: "${a.clientParamName?j_string}"