aboutsummaryrefslogtreecommitdiff
path: root/plugin/trace
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/trace')
-rw-r--r--plugin/trace/README.md2
-rw-r--r--plugin/trace/setup.go6
-rw-r--r--plugin/trace/setup_test.go17
-rw-r--r--plugin/trace/trace.go1
4 files changed, 17 insertions, 9 deletions
diff --git a/plugin/trace/README.md b/plugin/trace/README.md
index 6f8ecf692..78147f880 100644
--- a/plugin/trace/README.md
+++ b/plugin/trace/README.md
@@ -56,6 +56,8 @@ You can run Zipkin on a Docker host like this:
docker run -d -p 9411:9411 openzipkin/zipkin
```
+:warning: The zipkin provider does not support the v1 API since coredns 1.7.1
+
## Examples
Use an alternative Zipkin address:
diff --git a/plugin/trace/setup.go b/plugin/trace/setup.go
index 93d11766f..ad964bdc1 100644
--- a/plugin/trace/setup.go
+++ b/plugin/trace/setup.go
@@ -35,7 +35,9 @@ func traceParse(c *caddy.Controller) (*trace, error) {
)
cfg := dnsserver.GetConfig(c)
- tr.serviceEndpoint = cfg.ListenHosts[0] + ":" + cfg.Port
+ if cfg.ListenHosts[0] != "" {
+ tr.serviceEndpoint = cfg.ListenHosts[0] + ":" + cfg.Port
+ }
for c.Next() { // trace
var err error
@@ -115,7 +117,7 @@ func normalizeEndpoint(epType, ep string) (string, string, error) {
if epType == "zipkin" {
if !strings.Contains(ep, "http") {
- ep = "http://" + ep + "/api/v1/spans"
+ ep = "http://" + ep + "/api/v2/spans"
}
}
diff --git a/plugin/trace/setup_test.go b/plugin/trace/setup_test.go
index 1e3baaf4b..bbc5f987f 100644
--- a/plugin/trace/setup_test.go
+++ b/plugin/trace/setup_test.go
@@ -16,17 +16,17 @@ func TestTraceParse(t *testing.T) {
clientServer bool
}{
// oks
- {`trace`, false, "http://localhost:9411/api/v1/spans", 1, `coredns`, false},
- {`trace localhost:1234`, false, "http://localhost:1234/api/v1/spans", 1, `coredns`, false},
+ {`trace`, false, "http://localhost:9411/api/v2/spans", 1, `coredns`, false},
+ {`trace localhost:1234`, false, "http://localhost:1234/api/v2/spans", 1, `coredns`, false},
{`trace http://localhost:1234/somewhere/else`, false, "http://localhost:1234/somewhere/else", 1, `coredns`, false},
- {`trace zipkin localhost:1234`, false, "http://localhost:1234/api/v1/spans", 1, `coredns`, false},
+ {`trace zipkin localhost:1234`, false, "http://localhost:1234/api/v2/spans", 1, `coredns`, false},
{`trace datadog localhost`, false, "localhost", 1, `coredns`, false},
{`trace datadog http://localhost:8127`, false, "http://localhost:8127", 1, `coredns`, false},
{"trace datadog localhost {\n datadog_analytics_rate 0.1\n}", false, "localhost", 1, `coredns`, false},
- {"trace {\n every 100\n}", false, "http://localhost:9411/api/v1/spans", 100, `coredns`, false},
- {"trace {\n every 100\n service foobar\nclient_server\n}", false, "http://localhost:9411/api/v1/spans", 100, `foobar`, true},
- {"trace {\n every 2\n client_server true\n}", false, "http://localhost:9411/api/v1/spans", 2, `coredns`, true},
- {"trace {\n client_server false\n}", false, "http://localhost:9411/api/v1/spans", 1, `coredns`, false},
+ {"trace {\n every 100\n}", false, "http://localhost:9411/api/v2/spans", 100, `coredns`, false},
+ {"trace {\n every 100\n service foobar\nclient_server\n}", false, "http://localhost:9411/api/v2/spans", 100, `foobar`, true},
+ {"trace {\n every 2\n client_server true\n}", false, "http://localhost:9411/api/v2/spans", 2, `coredns`, true},
+ {"trace {\n client_server false\n}", false, "http://localhost:9411/api/v2/spans", 1, `coredns`, false},
// fails
{`trace footype localhost:4321`, true, "", 1, "", false},
{"trace {\n every 2\n client_server junk\n}", true, "", 1, "", false},
@@ -47,6 +47,9 @@ func TestTraceParse(t *testing.T) {
continue
}
+ if "" != m.serviceEndpoint {
+ t.Errorf("Test %v: Expected serviceEndpoint to be '' but found: %s", i, m.serviceEndpoint)
+ }
if test.endpoint != m.Endpoint {
t.Errorf("Test %v: Expected endpoint %s but found: %s", i, test.endpoint, m.Endpoint)
}
diff --git a/plugin/trace/trace.go b/plugin/trace/trace.go
index 4e1d1b4de..bbca68849 100644
--- a/plugin/trace/trace.go
+++ b/plugin/trace/trace.go
@@ -84,6 +84,7 @@ func (t *trace) setupZipkin() error {
tracer, err := zipkin.NewTracer(
reporter,
zipkin.WithLocalEndpoint(recorder),
+ zipkin.WithSharedSpans(t.clientServer),
)
if err != nil {
return err
Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/docs/src/pages/es/guides/debugging.md (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2021-11-19[ci] yarn formatGravatar matthewp 1-3/+3
2021-11-19Add Debug tests (#1882)Gravatar Matthew Phillips 4-0/+62
2021-11-19[ci] collect statsGravatar FredKSchott 1-0/+1
2021-11-19Version Packages (next) (#1881)astro@0.21.0-next.8@astrojs/renderer-vue@0.2.0-next.2Gravatar github-actions[bot] 25-23/+42
2021-11-18Improve HMR (#1896)Gravatar Drew Powers 2-10/+18
2021-11-18update depsGravatar Fred K. Schott 5-352/+65
2021-11-18fix #1778Gravatar Fred K. Schott 2-1/+8
2021-11-18Update compiler (#1869)Gravatar Nate Moore 3-11/+6
2021-11-18remove unused remark dependency (#1894)Gravatar Fred K. Schott 2-245/+13
2021-11-18Improve error messages (#1875)Gravatar Drew Powers 39-61/+448
2021-11-18pin astro compiler to older versionGravatar Fred K. Schott 2-5/+5
2021-11-18Update yarn.lock to reflect the state of the package.json files (#1892)Gravatar Jonathan Neal 5-1300/+1000
2021-11-19[ci] yarn formatGravatar FredKSchott 1-5/+3