From 5ab766bd664ac03d59b299d92fdce5536f785e27 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 26 Sep 2018 18:30:02 -0700 Subject: [PATCH] Update to OpenTracing-1.5 (#63) * Update dependencies (cherry picked from commit 8e3e8e266a041e90fb4f5160208337651d948805) * Update Datadog version to reference OpenTracing 1.5.0 compatible release. Updates readme to reflect all tracers latest version numbers. Fix extremely foolish error of mine in an example. * Change Lightstep to 0.8.1 * Change Lightstep to 0.8.1, not forgetting OpenResty image * Also update GRPC version to match that used by lightstep * Add instructions for installing protobuf. --- Dockerfile | 16 +++++++++------- Dockerfile-openresty | 8 ++++---- Dockerfile-test | 2 +- README.md | 10 +++++----- ci/build_module_binaries.sh | 2 +- example/trivial/datadog/go/server.go | 2 +- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9a4fe7f9..d7f0945f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,12 @@ ARG NGINX_LABEL=latest FROM nginx:${NGINX_LABEL} -ARG OPENTRACING_CPP_VERSION=v1.4.0 -ARG ZIPKIN_CPP_VERSION=v0.4.0 -ARG LIGHTSTEP_VERSION=v0.7.1 -ARG JAEGER_CPP_VERSION=v0.4.1 -ARG GRPC_VERSION=v1.4.x -ARG DATADOG_VERSION=v0.2.4 +ARG OPENTRACING_CPP_VERSION=v1.5.0 +ARG ZIPKIN_CPP_VERSION=v0.5.2 +ARG LIGHTSTEP_VERSION=v0.8.1 +ARG JAEGER_CPP_VERSION=v0.4.2 +ARG GRPC_VERSION=v1.10.x +ARG DATADOG_VERSION=v0.3.0 COPY . /src @@ -76,7 +76,7 @@ RUN set -x \ ### Build dd-opentracing-cpp && git clone -b $DATADOG_VERSION https://github.com/DataDog/dd-opentracing-cpp.git \ && cd dd-opentracing-cpp \ - && scripts/install_dependencies.sh not-opentracing not-curl \ + && scripts/install_dependencies.sh not-opentracing not-curl not-zlib \ && mkdir .build && cd .build \ && cmake -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF .. \ && make && make install \ @@ -88,6 +88,8 @@ RUN set -x \ && git submodule update --init \ && make HAS_SYSTEM_PROTOBUF=false && make install \ && make && make install \ + && cd third_party/protobuf \ + && make install \ && cd "$tempDir" \ ### Build lightstep-tracer-cpp && git clone -b $LIGHTSTEP_VERSION https://github.com/lightstep/lightstep-tracer-cpp.git \ diff --git a/Dockerfile-openresty b/Dockerfile-openresty index cbd80d7e..d02270e9 100644 --- a/Dockerfile-openresty +++ b/Dockerfile-openresty @@ -44,11 +44,11 @@ ARG RESTY_CONFIG_OPTIONS="\ --add-dynamic-module=/src/opentracing \ " ARG RESTY_CONFIG_OPTIONS_MORE="" -ARG OPENTRACING_CPP_VERSION="v1.4.0" +ARG OPENTRACING_CPP_VERSION="v1.5.0" ARG LUA_BRIDGE_TRACER_VERSION="9213e1b0c23a0d028093895d290c705680fbf4c5" -ARG JAEGER_VERSION="v0.4.1" -ARG LIGHTSTEP_VERSION="v0.7.1" -ARG ZIPKIN_VERSION="v0.4.0" +ARG JAEGER_VERSION="v0.4.2" +ARG LIGHTSTEP_VERSION="v0.8.1" +ARG ZIPKIN_VERSION="v0.5.2" LABEL resty_version="${RESTY_VERSION}" LABEL resty_luarocks_version="${RESTY_LUAROCKS_VERSION}" diff --git a/Dockerfile-test b/Dockerfile-test index 910bb4c8..51a5615c 100644 --- a/Dockerfile-test +++ b/Dockerfile-test @@ -1,6 +1,6 @@ FROM ubuntu:18.04 -ARG OPENTRACING_CPP_VERSION=v1.4.0 +ARG OPENTRACING_CPP_VERSION=v1.5.0 ARG NGINX_VERSION=1.13.12 COPY . /src diff --git a/README.md b/README.md index dfb5b87d..5b141c11 100644 --- a/README.md +++ b/README.md @@ -141,19 +141,19 @@ $ make && sudo make install ``` You will also need to install a C++ tracer for either [Jaeger](https://github.com/jaegertracing/jaeger-client-cpp), [LightStep]( -https://github.com/lightstep/lightstep-tracer-cpp), or [Zipkin](https://github.com/rnburn/zipkin-cpp-opentracing). For linux x86-64, portable binary plugins are available: +https://github.com/lightstep/lightstep-tracer-cpp), [Datadog](https://github.com/DataDog/dd-opentracing-cpp), or [Zipkin](https://github.com/rnburn/zipkin-cpp-opentracing). For linux x86-64, portable binary plugins are available: ``` # Jaeger -wget https://github.com/jaegertracing/jaeger-client-cpp/releases/download/v0.4.1/libjaegertracing_plugin.linux_amd64.so -O /usr/local/lib/libjaegertracing_plugin.so +wget https://github.com/jaegertracing/jaeger-client-cpp/releases/download/v0.4.2/libjaegertracing_plugin.linux_amd64.so -O /usr/local/lib/libjaegertracing_plugin.so # LightStep -wget -O - https://github.com/lightstep/lightstep-tracer-cpp/releases/download/v0.7.1/linux-amd64-liblightstep_tracer_plugin.so.gz | gunzip -c > /usr/local/lib/liblightstep_tracer_plugin.so +wget -O - https://github.com/lightstep/lightstep-tracer-cpp/releases/download/v0.8.1/linux-amd64-liblightstep_tracer_plugin.so.gz | gunzip -c > /usr/local/lib/liblightstep_tracer_plugin.so # Zipkin -wget -O - https://github.com/rnburn/zipkin-cpp-opentracing/releases/download/v0.4.0/linux-amd64-libzipkin_opentracing_plugin.so.gz | gunzip -c > /usr/local/lib/libzipkin_opentracing_plugin.so +wget -O - https://github.com/rnburn/zipkin-cpp-opentracing/releases/download/v0.5.2/linux-amd64-libzipkin_opentracing_plugin.so.gz | gunzip -c > /usr/local/lib/libzipkin_opentracing_plugin.so # Datadog -wget -O - https://github.com/DataDog/dd-opentracing-cpp/releases/download/v0.2.4/linux-amd64-libdd_opentracing_plugin.so.gz | gunzip -c > /usr/local/lib/libdd_opentracing_plugin.so +wget -O - https://github.com/DataDog/dd-opentracing-cpp/releases/download/v0.3.0/linux-amd64-libdd_opentracing_plugin.so.gz | gunzip -c > /usr/local/lib/libdd_opentracing_plugin.so ``` diff --git a/ci/build_module_binaries.sh b/ci/build_module_binaries.sh index ba034aec..dc2571ac 100755 --- a/ci/build_module_binaries.sh +++ b/ci/build_module_binaries.sh @@ -2,7 +2,7 @@ set -e -export OPENTRACING_VERSION=1.4.0 +export OPENTRACING_VERSION=1.5.0 NGINX_VERSIONS=(1.15.0 1.14.0 1.13.12 1.12.2) # Compile for a portable cpu architecture diff --git a/example/trivial/datadog/go/server.go b/example/trivial/datadog/go/server.go index c91d0450..514dfbf0 100644 --- a/example/trivial/datadog/go/server.go +++ b/example/trivial/datadog/go/server.go @@ -20,7 +20,7 @@ var collectorHost = flag.String("collector_host", "dd-agent", "Host for Datadog var collectorPort = flag.String("collector_port", "8126", "Port for Datadog agent") func handler(w http.ResponseWriter, r *http.Request) { - wireContext, err := opentracing.GlobalTracer().Extract( + wireContext, _ := opentracing.GlobalTracer().Extract( opentracing.HTTPHeaders, opentracing.HTTPHeadersCarrier(r.Header)) span := opentracing.StartSpan("GET /", opentracing.ChildOf(wireContext))