Baoyuantop commented on code in PR #11943: URL: https://github.com/apache/apisix/pull/11943#discussion_r2149310725
########## apisix/plugins/datadog.lua: ########## @@ -80,10 +89,24 @@ local function generate_tag(entry, const_tags) tags = {} end + if entry.constant_tags and #entry.constant_tags > 0 then + for _, tag in pairs(entry.constant_tags) do + core.table.insert(tags, tag) Review Comment: It is recommended that label format validation be added to ensure that labels conform to Datadog's label specifications (e.g., character limits, length limits, etc.) ########## apisix/plugins/datadog.lua: ########## @@ -80,10 +89,24 @@ local function generate_tag(entry, const_tags) tags = {} end + if entry.constant_tags and #entry.constant_tags > 0 then + for _, tag in pairs(entry.constant_tags) do + core.table.insert(tags, tag) + end + end + if entry.route_id and entry.route_id ~= "" then core.table.insert(tags, "route_name:" .. entry.route_id) end + if entry.path and entry.path ~= "" then Review Comment: Can you use functions to reduce duplicate code? -- 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: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org