You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "Baoyuantop (via GitHub)" <gi...@apache.org> on 2025/06/16 08:12:05 UTC
Re: [PR] feat(datadog): Improve Datadog plugin tag support [apisix]
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org