mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 02:03:13 -05:00
Various trace improvements (#527)
This commit is contained in:
committed by
Miek Gieben
parent
bd033ef6c7
commit
5aa30308d9
@@ -5,26 +5,42 @@ middleware chain.
|
||||
|
||||
## Syntax
|
||||
|
||||
The simplest form is just:
|
||||
|
||||
~~~
|
||||
trace [ENDPOINT-TYPE] [ENDPOINT]
|
||||
~~~
|
||||
|
||||
For each server you which to trace.
|
||||
* **ENDPOINT-TYPE** is the type of tracing destination. Currently only `zipkin` is supported
|
||||
and that is what it defaults to.
|
||||
* **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`.
|
||||
|
||||
It optionally takes the ENDPOINT-TYPE and ENDPOINT. The ENDPOINT-TYPE defaults to
|
||||
`zipkin` and the ENDPOINT to `localhost:9411`. A single argument will be interpreted as
|
||||
a Zipkin ENDPOINT.
|
||||
With this form, all queries will be traced.
|
||||
|
||||
The only ENDPOINT-TYPE supported so far is `zipkin`. You can run Zipkin on a Docker host
|
||||
like this:
|
||||
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
|
||||
```
|
||||
|
||||
For Zipkin, if ENDPOINT does not begin with `http`, then it will be transformed to
|
||||
`http://ENDPOINT/api/v1/spans`.
|
||||
|
||||
## Examples
|
||||
|
||||
Use an alternative Zipkin address:
|
||||
@@ -45,3 +61,13 @@ the standard Zipkin URL you can do something like:
|
||||
~~~
|
||||
trace http://tracinghost:9411/zipkin/api/v1/spans
|
||||
~~~
|
||||
|
||||
Trace one query every 10000 queries, rename the service, and enable same span:
|
||||
|
||||
~~~
|
||||
trace tracinghost:9411 {
|
||||
every 10000
|
||||
service dnsproxy
|
||||
client_server
|
||||
}
|
||||
~~~
|
||||
|
||||
Reference in New Issue
Block a user