Skip to content

Commit eb28470

Browse files
Merge pull request #9 from appoptics/switch-to-main-liboboe
Update transform_id for W3C Metadata creation and Reporter init
2 parents dadcecb + d646021 commit eb28470

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

Diff for: README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ The custom distro to extend the OpenTelemetry Python agent for compatibility wit
66

77
### Git Repos and Directory Structure
88

9-
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:
9+
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:
1010
```
1111
~/gitrepos/
1212
|
13-
|----otel-oboe/
13+
|----oboe/
1414
|
1515
|----opentelemetry-python-instrumentation-custom-distro/
1616
```
17+
Then in `oboe`, checkout the [add-otel-oboe-features branch](https://github.com/librato/oboe/tree/add-otel-oboe-features).
1718

1819
### Development (Build) Container
1920

@@ -32,7 +33,7 @@ Then you can start a build container by running `./run_docker_dev.sh` from withi
3233
./run_docker_dev.sh
3334
```
3435
from within the `dev_tools` directory.
35-
* Inside the docker container, you can now build the agent with the provided Makefile.
36+
* Inside the docker container, you can now build the agent with the provided Makefile in the container's `dev_tools` directory.
3637

3738
### Install Agent from Source in Development Mode
3839
* Execute `make wrapper` inside the build container. This copies the C-extension artifacts and builds the SWIG bindings.

Diff for: dev_tools/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ SHELL=bash
1919
#----------------------------------------------------------------------------------------------------------------------#
2020
# variable definitions and recipes for downloading of required header and library files
2121
#----------------------------------------------------------------------------------------------------------------------#
22-
OTELOBOEREPO := /code/otel_oboe/liboboe
22+
OTELOBOEREPO := /code/oboe/liboboe
2323

2424
# Copy the pre-compiled liboboe shared library from source specified in OTELOBOEREPO
2525
copy-liboboe:
@@ -58,7 +58,7 @@ copy-bson-headers:
5858
if [ $$? -ne 0 ]; then echo " **** fail to copy $$i ****" ; exit 1; fi; \
5959
done
6060

61-
# copy artifacts from local otel-oboe
61+
# copy artifacts from local oboe
6262
copy-all: copy-headers copy-liboboe
6363

6464
#----------------------------------------------------------------------------------------------------------------------#

Diff for: dev_tools/run_docker_dev.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ docker run -it \
1111
--cap-add SYS_PTRACE \
1212
--workdir /code/opentelemetry_distro_solarwinds \
1313
-v "$PWD"/..:/code/opentelemetry_distro_solarwinds \
14-
-v "$PWD"/../../otel-oboe/:/code/otel_oboe \
14+
-v "$PWD"/../../oboe/:/code/oboe \
1515
-v `echo ~`:/home/developer \
1616
dev-container bash

Diff for: opentelemetry_distro_solarwinds/exporter.py

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def _initialize_solarwinds_reporter(self):
117117
grpc_proxy='',
118118
stdout_clear_nonblocking=0,
119119
is_grpc_clean_hack_enabled=False,
120+
w3c_trace_format=1,
120121
)
121122

122123
@staticmethod

Diff for: opentelemetry_distro_solarwinds/ot_ao_transformer.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
"""
33

44
import logging
5+
import os
56

67
logger = logging.getLogger(__file__)
78

89

910
def transform_id(span_context):
10-
"""Generates an AppOptics X-Trace ID from the provided OpenTelemetry span context."""
11-
xtr = "2B{0:032X}00000000{1:016X}0{2}".format(span_context.trace_id,
12-
span_context.span_id,
13-
span_context.trace_flags)
14-
logger.debug("Generated X-Trace %s from span context %s", xtr,
11+
"""Generates a liboboe W3C compatible trace_context from provided OTel span context."""
12+
xtr = "00-{0:032X}-{1:016X}-{2:02X}".format(span_context.trace_id,
13+
span_context.span_id,
14+
span_context.trace_flags)
15+
logger.debug("Generated trace_context %s from span context %s", xtr,
1516
span_context)
1617
return xtr

0 commit comments

Comments
 (0)