DataDog / kong-plugin-ddtrace

Datadog APM Plugin for Kong Gateway
Apache License 2.0
15 stars 7 forks source link

Add DNS Resolve Time in Span Tag #4

Closed pusponegorow closed 6 months ago

pusponegorow commented 1 year ago

I'm using Kong 3.3.0 and i need a DNS resolve time to give us more visibility breakdown latency.

i already added my code to add this in my environment. This is the example:

image

code:

  if  ngx_ctx.KONG_UPSTREAM_DNS_END_AT and ngx_ctx.KONG_UPSTREAM_DNS_START then
        local upstream_dns_time = ngx_ctx.KONG_UPSTREAM_DNS_END_AT - ngx_ctx.KONG_UPSTREAM_DNS_START
        request_span:set_tag("dns.resolve_time_start", ngx_ctx.KONG_UPSTREAM_DNS_START)
        request_span:set_tag("dns.resolve_time_end_at", ngx_ctx.KONG_UPSTREAM_DNS_END_AT)
        request_span:set_tag("dns.resolve_time", upstream_dns_time)
    end
pusponegorow commented 11 months ago

up this enhancement