From d0ed814669308e775513583f69562cf6a9dd670f Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 15 Oct 2019 16:30:06 +0200 Subject: [PATCH] Update jaeger dependencies --- go.mod | 4 +- go.sum | 8 +-- .../fixtures/tracing/simple-jaeger.toml | 1 + integration/resources/compose/tracing.yml | 4 +- integration/tracing_test.go | 56 +++++++++++++++---- 5 files changed, 53 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 0bc1b3eba..bbf825fb4 100644 --- a/go.mod +++ b/go.mod @@ -79,8 +79,8 @@ require ( github.com/stvp/go-udp-testing v0.0.0-20171104055251-c4434f09ec13 github.com/tinylib/msgp v1.0.2 // indirect github.com/transip/gotransip v5.8.2+incompatible // indirect - github.com/uber/jaeger-client-go v2.16.0+incompatible - github.com/uber/jaeger-lib v2.0.0+incompatible + github.com/uber/jaeger-client-go v2.19.0+incompatible + github.com/uber/jaeger-lib v2.2.0+incompatible github.com/unrolled/render v1.0.1 github.com/unrolled/secure v1.0.4 github.com/vdemeester/shakers v0.1.0 diff --git a/go.sum b/go.sum index dcebb5ef1..874f49b46 100644 --- a/go.sum +++ b/go.sum @@ -481,10 +481,10 @@ github.com/transip/gotransip v5.8.2+incompatible h1:aNJhw/w/3QBqFcHAIPz1ytoK5Fex github.com/transip/gotransip v5.8.2+incompatible/go.mod h1:uacMoJVmrfOcscM4Bi5NVg708b7c6rz2oDTWqa7i2Ic= github.com/uber-go/atomic v1.3.2 h1:Azu9lPBWRNKzYXSIwRfgRuDuS0YKsK4NFhiQv98gkxo= github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= -github.com/uber/jaeger-client-go v2.16.0+incompatible h1:Q2Pp6v3QYiocMxomCaJuwQGFt7E53bPYqEgug/AoBtY= -github.com/uber/jaeger-client-go v2.16.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.0.0+incompatible h1:iMSCV0rmXEogjNWPh2D0xk9YVKvrtGoHJNe9ebLu/pw= -github.com/uber/jaeger-lib v2.0.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= +github.com/uber/jaeger-client-go v2.19.0+incompatible h1:pbwbYfHUoaase0oPQOdZ1GcaUjImYGimUXSQ/+8+Z8Q= +github.com/uber/jaeger-client-go v2.19.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw= +github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v0.0.0-20171019201919-bdcc60b419d1/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= github.com/unrolled/render v1.0.1 h1:VDDnQQVfBMsOsp3VaCJszSO0nkBIVEYoPWeRThk9spY= github.com/unrolled/render v1.0.1/go.mod h1:gN9T0NhL4Bfbwu8ann7Ry/TGHYfosul+J0obPf6NBdM= diff --git a/integration/fixtures/tracing/simple-jaeger.toml b/integration/fixtures/tracing/simple-jaeger.toml index fea514f79..056d15b4b 100644 --- a/integration/fixtures/tracing/simple-jaeger.toml +++ b/integration/fixtures/tracing/simple-jaeger.toml @@ -19,6 +19,7 @@ samplingParam = 1.0 samplingServerURL = "http://{{.IP}}:5778/sampling" localAgentHostPort = "{{.IP}}:6831" + traceContextHeaderName = "{{.TraceContextHeaderName}}" [providers.file] filename = "{{ .SelfFilename }}" diff --git a/integration/resources/compose/tracing.yml b/integration/resources/compose/tracing.yml index 2e3f1de7b..daad06af5 100644 --- a/integration/resources/compose/tracing.yml +++ b/integration/resources/compose/tracing.yml @@ -6,7 +6,7 @@ zipkin: ports: - 9411:9411 jaeger: - image: jaegertracing/all-in-one:1.12 + image: jaegertracing/all-in-one:1.14 environment: COLLECTOR_ZIPKIN_HTTP_PORT: 9411 ports: @@ -18,4 +18,4 @@ jaeger: - "14268:14268" - "9411:9411" whoami: - image: containous/whoami \ No newline at end of file + image: containous/whoami diff --git a/integration/tracing_test.go b/integration/tracing_test.go index 07b1d3438..27a09e78e 100644 --- a/integration/tracing_test.go +++ b/integration/tracing_test.go @@ -18,9 +18,10 @@ type TracingSuite struct { } type TracingTemplate struct { - WhoAmiIP string - WhoAmiPort int - IP string + WhoAmiIP string + WhoAmiPort int + IP string + TraceContextHeaderName string } func (s *TracingSuite) SetUpSuite(c *check.C) { @@ -157,9 +158,10 @@ func (s *TracingSuite) TestJaegerRateLimit(c *check.C) { s.startJaeger(c) defer s.composeProject.Stop(c, "jaeger") file := s.adaptFile(c, "fixtures/tracing/simple-jaeger.toml", TracingTemplate{ - WhoAmiIP: s.WhoAmiIP, - WhoAmiPort: s.WhoAmiPort, - IP: s.IP, + WhoAmiIP: s.WhoAmiIP, + WhoAmiPort: s.WhoAmiPort, + IP: s.IP, + TraceContextHeaderName: "uber-trace-id", }) defer os.Remove(file) @@ -206,9 +208,10 @@ func (s *TracingSuite) TestJaegerRetry(c *check.C) { s.startJaeger(c) defer s.composeProject.Stop(c, "jaeger") file := s.adaptFile(c, "fixtures/tracing/simple-jaeger.toml", TracingTemplate{ - WhoAmiIP: s.WhoAmiIP, - WhoAmiPort: 81, - IP: s.IP, + WhoAmiIP: s.WhoAmiIP, + WhoAmiPort: 81, + IP: s.IP, + TraceContextHeaderName: "uber-trace-id", }) defer os.Remove(file) @@ -233,9 +236,38 @@ func (s *TracingSuite) TestJaegerAuth(c *check.C) { s.startJaeger(c) defer s.composeProject.Stop(c, "jaeger") file := s.adaptFile(c, "fixtures/tracing/simple-jaeger.toml", TracingTemplate{ - WhoAmiIP: s.WhoAmiIP, - WhoAmiPort: s.WhoAmiPort, - IP: s.IP, + WhoAmiIP: s.WhoAmiIP, + WhoAmiPort: s.WhoAmiPort, + IP: s.IP, + TraceContextHeaderName: "uber-trace-id", + }) + defer os.Remove(file) + + cmd, display := s.traefikCmd(withConfigFile(file)) + defer display(c) + err := cmd.Start() + c.Assert(err, checker.IsNil) + defer cmd.Process.Kill() + + // wait for traefik + err = try.GetRequest("http://127.0.0.1:8080/api/rawdata", time.Second, try.BodyContains("basic-auth")) + c.Assert(err, checker.IsNil) + + err = try.GetRequest("http://127.0.0.1:8000/auth", 500*time.Millisecond, try.StatusCodeIs(http.StatusUnauthorized)) + c.Assert(err, checker.IsNil) + + err = try.GetRequest("http://"+s.IP+":16686/api/traces?service=tracing", 20*time.Second, try.BodyContains("EntryPoint web", "basic-auth@file")) + c.Assert(err, checker.IsNil) +} + +func (s *TracingSuite) TestJaegerCustomHeader(c *check.C) { + s.startJaeger(c) + defer s.composeProject.Stop(c, "jaeger") + file := s.adaptFile(c, "fixtures/tracing/simple-jaeger.toml", TracingTemplate{ + WhoAmiIP: s.WhoAmiIP, + WhoAmiPort: s.WhoAmiPort, + IP: s.IP, + TraceContextHeaderName: "powpow", }) defer os.Remove(file)