From fe04b15fb2892ca4873ef8ed657105a1279691b0 Mon Sep 17 00:00:00 2001 From: Shenglian Zhou Date: Tue, 10 Aug 2021 08:37:56 +0800 Subject: [PATCH] [TD-5861]:distinguish between tags and metrics values --- src/plugins/http/src/httpMetricsHandle.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/plugins/http/src/httpMetricsHandle.c b/src/plugins/http/src/httpMetricsHandle.c index e8d10957e8..9a9e564823 100644 --- a/src/plugins/http/src/httpMetricsHandle.c +++ b/src/plugins/http/src/httpMetricsHandle.c @@ -31,9 +31,21 @@ bool metricsProcessRequest(HttpContext* pContext) { httpJsonToken(jsonBuf, JsonObjStt); { + char* keyDisks = "tags"; + httpJsonPairHead(jsonBuf, keyDisks, (int32_t)strlen(keyDisks)); + httpJsonToken(jsonBuf, JsonArrStt); + { + httpJsonItemToken(jsonBuf); + httpJsonToken(jsonBuf, JsonObjStt); + char* keyTagName = "name"; + char* keyTagValue = "value"; + httpJsonPairOriginString(jsonBuf, keyTagName, (int32_t)strlen(keyTagName), "dnode_id", + (int32_t)strlen("dnode_id")); int32_t dnodeId = dnodeGetDnodeId(); - char* keyDnodeId = "dnode_id"; - httpJsonPairIntVal(jsonBuf, keyDnodeId, (int32_t)strlen(keyDnodeId), dnodeId); + httpJsonPairIntVal(jsonBuf, keyTagValue, (int32_t)strlen(keyTagValue), dnodeId); + httpJsonToken(jsonBuf, JsonObjEnd); + } + httpJsonToken(jsonBuf, JsonArrEnd); } { -- GitLab