Closed xpdable closed 10 months ago
I tested locally, it works. I will refactory the logic and make a PR.
schema.lua:
...
{ host = allow_referenceable(typedefs.ip({ default = "127.0.0.1" })) },
{ port = { type = "string", default = "none" } },
{ version = { type = "string", default = "none" } },
...
handler.lua:
...
local function get_agent_writer(conf)
if agent_writer_cache[conf] == nil then
-- TODO: logic that tell if agent_endpoint set or host set.
local host = conf.host
local port = conf.port
local version = conf.version
conf.agent_endpoint = string.format("http://%s:%d/%s/traces", host, port, version)
...
Hi @xpdable
Thank you for reporting this issue. I wanted to inform you that we recently merged the fix in https://github.com/DataDog/kong-plugin-ddtrace/pull/27. This solution should address the problem you raised, and it will be included in the upcoming release.
Similar with #15 , we are deploying kong with helm into EKS and the endpoint is dynamic. With the same usage of datadog-kong-plugin (https://docs.konghq.com/hub/kong-inc/datadog/), we fetch the ip and config the plugin as below:
The datadog plugin works in this way. however the ddtrace plugin does not work. Please refer the error below:
Can you give some insight? Can ddtrace deal with it in the same way of datadog? Thanks
for example: ( split each part and construct endpoint in the plugin? )
Also workable that if endpoint parameter exists, drop all others i.e. host, port...