diff --git a/README.md b/README.md index 1af2bf29..b28c244c 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,15 @@ The custom distro to extend the OpenTelemetry Python agent for compatibility wit ### Git Repos and Directory Structure -The code in this repository makes use of code located in the [otel-oboe](https://github.com/librato/otel-oboe) GIT repository. Thus, first make sure that you clone the following repositories into the same root directory. For example, if your development directory is `~/gitrepos/`, please clone the `otel-oboe` and the `opentelemetry-python-instrumentation-custom-distro` repositories under `~/gitrepos`, so that your directory structure looks as shown below: +The code in this repository makes use of code located in an experimental branch of the [oboe](https://github.com/librato/oboe) GIT repository. Thus, first make sure that you clone the following repositories into the same root directory. For example, if your development directory is `~/gitrepos/`, please clone the `oboe` and the `opentelemetry-python-instrumentation-custom-distro` repositories under `~/gitrepos`, so that your directory structure looks as shown below: ``` ~/gitrepos/ | -|----otel-oboe/ +|----oboe/ | |----opentelemetry-python-instrumentation-custom-distro/ ``` +Then in `oboe`, checkout the [add-otel-oboe-features branch](https://github.com/librato/oboe/tree/add-otel-oboe-features). ### Development (Build) Container @@ -32,7 +33,7 @@ Then you can start a build container by running `./run_docker_dev.sh` from withi ./run_docker_dev.sh ``` from within the `dev_tools` directory. -* Inside the docker container, you can now build the agent with the provided Makefile. +* Inside the docker container, you can now build the agent with the provided Makefile in the container's `dev_tools` directory. ### Install Agent from Source in Development Mode * Execute `make wrapper` inside the build container. This copies the C-extension artifacts and builds the SWIG bindings. diff --git a/dev_tools/Makefile b/dev_tools/Makefile index 6719ce21..9985a462 100644 --- a/dev_tools/Makefile +++ b/dev_tools/Makefile @@ -19,7 +19,7 @@ SHELL=bash #----------------------------------------------------------------------------------------------------------------------# # variable definitions and recipes for downloading of required header and library files #----------------------------------------------------------------------------------------------------------------------# -OTELOBOEREPO := /code/otel_oboe/liboboe +OTELOBOEREPO := /code/oboe/liboboe # Copy the pre-compiled liboboe shared library from source specified in OTELOBOEREPO copy-liboboe: @@ -58,7 +58,7 @@ copy-bson-headers: if [ $$? -ne 0 ]; then echo " **** fail to copy $$i ****" ; exit 1; fi; \ done -# copy artifacts from local otel-oboe +# copy artifacts from local oboe copy-all: copy-headers copy-liboboe #----------------------------------------------------------------------------------------------------------------------# diff --git a/dev_tools/run_docker_dev.sh b/dev_tools/run_docker_dev.sh index 0cce919a..75f098d4 100755 --- a/dev_tools/run_docker_dev.sh +++ b/dev_tools/run_docker_dev.sh @@ -11,6 +11,6 @@ docker run -it \ --cap-add SYS_PTRACE \ --workdir /code/opentelemetry_distro_solarwinds \ -v "$PWD"/..:/code/opentelemetry_distro_solarwinds \ - -v "$PWD"/../../otel-oboe/:/code/otel_oboe \ + -v "$PWD"/../../oboe/:/code/oboe \ -v `echo ~`:/home/developer \ dev-container bash diff --git a/opentelemetry_distro_solarwinds/exporter.py b/opentelemetry_distro_solarwinds/exporter.py index d0a2ae30..9b2d5521 100644 --- a/opentelemetry_distro_solarwinds/exporter.py +++ b/opentelemetry_distro_solarwinds/exporter.py @@ -117,6 +117,7 @@ def _initialize_solarwinds_reporter(self): grpc_proxy='', stdout_clear_nonblocking=0, is_grpc_clean_hack_enabled=False, + w3c_trace_format=1, ) @staticmethod diff --git a/opentelemetry_distro_solarwinds/ot_ao_transformer.py b/opentelemetry_distro_solarwinds/ot_ao_transformer.py index 8ee0629e..21f01cdf 100644 --- a/opentelemetry_distro_solarwinds/ot_ao_transformer.py +++ b/opentelemetry_distro_solarwinds/ot_ao_transformer.py @@ -2,15 +2,16 @@ """ import logging +import os logger = logging.getLogger(__file__) def transform_id(span_context): - """Generates an AppOptics X-Trace ID from the provided OpenTelemetry span context.""" - xtr = "2B{0:032X}00000000{1:016X}0{2}".format(span_context.trace_id, - span_context.span_id, - span_context.trace_flags) - logger.debug("Generated X-Trace %s from span context %s", xtr, + """Generates a liboboe W3C compatible trace_context from provided OTel span context.""" + xtr = "00-{0:032X}-{1:016X}-{2:02X}".format(span_context.trace_id, + span_context.span_id, + span_context.trace_flags) + logger.debug("Generated trace_context %s from span context %s", xtr, span_context) return xtr