COREDNS-TRACE(7)

πŸ“¦
version 1.15.0 Β· 3 versions
, in opensuse-leap 16.0

πŸ’… COREDNS-TRACE(7)

ok so bestie, you're looking at the trace plugin page from the CoreDNS Plugins manual, section 7 β€” like, the actual real one. grab a strawberry πŸ“ and let's get into it.


✨ NAME ✨

trace β€” it turns on OpenTracing-based tracing of DNS requests as they travel through the plugin chain. literally watching your queries do their little journey. main character energy for packets πŸ¦‹


🌸 DESCRIPTION 🌸

with trace you enable OpenTracing of how a request flows through CoreDNS. that's the whole vibe.

heads up bestie: enable the debug plugin if you want to actually get logs from the trace plugin. no debug, no logs, that's just how it is 😭

πŸŽ€ SYNTAX πŸŽ€

the simplest form is literally just this:

trace [ENDPOINT-TYPE] [ENDPOINT]
  • ENDPOINT-TYPE β€” the type of tracing destination. currently only zipkin and datadog are supported (yes, just those two, no cap). defaults to zipkin.
  • ENDPOINT β€” the tracing destination, and it defaults to localhost:9411. for Zipkin, if ENDPOINT does not begin with http:// or https:// (case-insensitive, so don't try to be cute), then it will be transformed to http://ENDPOINT/api/v2/spans.

with this form, all queries will be traced. every single one. obsessed. ✨


additional features can be enabled with this syntax:

trace [ENDPOINT-TYPE] [ENDPOINT] {
    every AMOUNT
    service NAME
    client_server
    datadog_analytics_rate RATE
    zipkin_max_backlog_size SIZE
    zipkin_max_batch_size SIZE
    zipkin_max_batch_interval DURATION
}
  • every AMOUNT β€” will only trace one query of each AMOUNT queries. for example, to trace 1 in every 100 queries, use AMOUNT of 100. the default is 1. (so by default it's tracing everything, go off πŸ‘‘)
  • service NAME β€” lets you specify the service name reported to the tracing server. default is coredns.
  • client_server β€” will enable the ClientServerSameSpan OpenTracing feature.
  • datadog_analytics_rate RATE β€” will enable trace analytics (<https://docs.datadoghq.com/tracing/app_analytics>) on the traces sent, from 0 to 1, 1 being every trace sent will be analyzed. this is a datadog only feature (ENDPOINT-TYPE needs to be datadog), so don't come crying to me if you set it with zipkin πŸ™ˆ
  • zipkin_max_backlog_size β€” configures the maximum backlog size for Zipkin HTTP reporter. when batch size reaches this threshold, spans from the beginning of the batch will be disposed. default is 1000 backlog size.
  • zipkin_max_batch_size β€” configures the maximum batch size for Zipkin HTTP reporter, after which a collect will be triggered. the default batch size is 100 traces.
  • zipkin_max_batch_interval β€” configures the maximum duration we will buffer traces before emitting them to the collector using Zipkin HTTP reporter. the default batch interval is 1 second.

🧚 ZIPKIN 🧚

you can run Zipkin on a Docker host like this:

docker run -d -p 9411:9411 openzipkin/zipkin
⚠️ note the zipkin provider does not support the v1 API since coredns 1.7.1. that's a real caveat, not a vibe, so plan accordingly πŸ’€

πŸ”₯ EXAMPLES πŸ”₯

use an alternative Zipkin address:

trace tracinghost:9253

or

. {
    trace zipkin tracinghost:9253
}

if for some reason you are using an API reverse proxy or something and need to remap the standard Zipkin URL you can do something like:

trace http://tracinghost:9411/zipkin/api/v2/spans

using DataDog:

trace datadog localhost:8126

trace one query every 10000 queries, rename the service, and enable same span:

trace tracinghost:9411 {
    every 10000
    service dnsproxy
    client_server
}

ate. no crumbs. πŸ’…


🌈 METADATA 🌈

the trace plugin will publish the following metadata, if the metadata plugin is also enabled:

  • trace/traceid: identifier of (zipkin/datadog) trace of processed request

⭐ SEE ALSO ⭐

see the debug plugin for more information about debug logging. (yes, it came up twice, it's that important 🫢)


that's the whole page bestie, you're officially a tracing girly now πŸŽ€

CoreDNS β€” October 2026 πŸ’– go trace something iconic ✨

πŸ“¦ where this page comes from