coredns/plugin/trace
Miek Gieben 24176a97e6
Move to CODEOWNERS (#3489)
* Move to CODEOWNERS

No change in who own what; just a move to CODEOWNERS. This allows
dreck cleanups.

Added .dreck.yaml for alias and exec.

Fixes: #3486

Signed-off-by: Miek Gieben <miek@miek.nl>

* stickler bot

Signed-off-by: Miek Gieben <miek@miek.nl>

* sort the file

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-11-29 13:17:05 +00:00
..
log_test.go Clean up tests logging (#1979) 2018-07-19 16:23:06 +01:00
README.md Add DD support (#1596) 2018-03-09 15:08:57 -05:00
setup.go all: simply registering plugins (#3287) 2019-09-20 08:02:30 +01:00
setup_test.go Update Caddy to 1.0.1, and update import path (#2961) 2019-07-03 09:04:47 +08:00
trace.go Move github.com/openzipkin/zipkin-go-opentracing => github.com/openzipkin-contrib/zipkin-go-opentracing (#3070) 2019-07-31 06:44:56 +00:00
trace_test.go Run gostaticheck (#3325) 2019-10-01 07:41:29 +01:00

trace

Name

trace - enables OpenTracing-based tracing of DNS requests as they go through the plugin chain.

Description

With trace you enable OpenTracing of how a request flows through CoreDNS.

Syntax

The simplest form is just:

trace [ENDPOINT-TYPE] [ENDPOINT]
  • ENDPOINT-TYPE is the type of tracing destination. Currently only zipkin and datadog are supported. Defaults to zipkin.
  • ENDPOINT is the tracing destination, and defaults to localhost:9411. For Zipkin, if ENDPOINT does not begin with http, then it will be transformed to http://ENDPOINT/api/v1/spans.

With this form, all queries will be traced.

Additional features can be enabled with this syntax:

trace [ENDPOINT-TYPE] [ENDPOINT] {
	every AMOUNT
	service NAME
	client_server
}
  • 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.
  • service NAME allows you to specify the service name reported to the tracing server. Default is coredns.
  • client_server will enable the ClientServerSameSpan OpenTracing feature.

Zipkin

You can run Zipkin on a Docker host like this:

docker run -d -p 9411:9411 openzipkin/zipkin

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/v1/spans

Using DataDog:

trace datadog localhost:8125

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

trace tracinghost:9411 {
	every 10000
	service dnsproxy
	client_server
}