Skip to content

Commit dbe65f2

Browse files
committed
Use splunk-otel-python for python auto-instrumentation
1 parent debf305 commit dbe65f2

File tree

6 files changed

+79
-13
lines changed

6 files changed

+79
-13
lines changed

examples/enable-operator-and-auto-instrumentation/rendered_manifests/operator/instrumentation.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ spec:
7272
python:
7373
env:
7474
- name: OTEL_RESOURCE_ATTRIBUTES
75-
value: splunk.zc.method=autoinstrumentation-python:0.54b1
75+
value: splunk.zc.method=splunk-otel-instrumentation-python:v2.6.0
7676
- name: OTEL_EXPORTER_OTLP_ENDPOINT
7777
value: http://default-splunk-otel-collector-agent.default.svc.cluster.local:4318
78-
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python:0.54b1
78+
image: quay.io/signalfx/splunk-otel-instrumentation-python:v2.6.0

functional_tests/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ Run the following commands prior to running the test locally:
66
```
77
export KUBECONFIG=/tmp/kube-config-splunk-otel-collector-chart-functional-testing
88
export KUBE_TEST_ENV=kind
9-
export K8S_VERSION=v1.29.0
9+
export K8S_VERSION=v1.31.0
1010
kind create cluster --kubeconfig=/tmp/kube-config-splunk-otel-collector-chart-functional-testing --config=.github/workflows/configs/kind-config.yaml --image=kindest/node:$K8S_VERSION
1111
kubectl get csr -o=jsonpath='{range.items[?(@.spec.signerName=="kubernetes.io/kubelet-serving")]}{.metadata.name}{" "}{end}' | xargs kubectl certificate approve
1212
make dep-update
1313
kind load docker-image quay.io/splunko11ytest/nodejs_test:latest --name kind
1414
kind load docker-image quay.io/splunko11ytest/java_test:latest --name kind
1515
kind load docker-image quay.io/splunko11ytest/dotnet_test:latest --name kind
16+
kind load docker-image quay.io/splunko11ytest/python_test:latest --name kind
1617
# On Mac M1s, you can also push this image so kind doesn't get confused with the platform to use:
17-
kind load docker-image ghcr.io/signalfx/splunk-otel-dotnet/splunk-otel-dotnet:v1.8.0 --name kind
18-
kind load docker-image ghcr.io/signalfx/splunk-otel-js/splunk-otel-js:v3.1.2 --name kind
19-
kind load docker-image ghcr.io/signalfx/splunk-otel-java/splunk-otel-java:v1.30.0 --name kind
20-
kind load docker-image ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python:0.50b0 --name kind
18+
kind load docker-image ghcr.io/signalfx/splunk-otel-dotnet/splunk-otel-dotnet:v1.11.0 --name kind
19+
kind load docker-image ghcr.io/signalfx/splunk-otel-js/splunk-otel-js:v3.3.0 --name kind
20+
kind load docker-image ghcr.io/signalfx/splunk-otel-java/splunk-otel-java:v2.18.0 --name kind
21+
kind load docker-image quay.io/signalfx/splunk-otel-instrumentation-python:v2.6.0 --name kind
2122
```
2223

2324
## Config switches

functional_tests/functional/testdata/expected_kind_values/expected_python_traces.yaml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,42 @@ resourceSpans:
99
stringValue: opentelemetry
1010
- key: telemetry.sdk.version
1111
value:
12-
stringValue: 1.33.1
12+
stringValue: 1.35.0
13+
- key: process.runtime.description
14+
value:
15+
stringValue: 3.13.1 (main, Jan 24 2025, 21:33:38) [GCC 14.2.0]
16+
- key: process.runtime.name
17+
value:
18+
stringValue: cpython
19+
- key: process.runtime.version
20+
value:
21+
stringValue: 3.13.1
22+
- key: process.pid
23+
value:
24+
intValue: "25"
25+
- key: process.executable.name
26+
value:
27+
stringValue: /usr/local/bin/python3
28+
- key: process.executable.path
29+
value:
30+
stringValue: /usr/local/bin
31+
- key: process.command
32+
value:
33+
stringValue: web.py
34+
- key: process.command_line
35+
value:
36+
stringValue: web.py
37+
- key: process.command_args
38+
value:
39+
arrayValue:
40+
values:
41+
- stringValue: web.py
42+
- key: process.parent_pid
43+
value:
44+
intValue: "1"
1345
- key: splunk.zc.method
1446
value:
15-
stringValue: autoinstrumentation-python:0.54b1
47+
stringValue: splunk-otel-instrumentation-python:v2.6.0
1648
- key: k8s.container.name
1749
value:
1850
stringValue: python-test
@@ -40,12 +72,21 @@ resourceSpans:
4072
- key: service.version
4173
value:
4274
stringValue: latest
75+
- key: telemetry.distro.name
76+
value:
77+
stringValue: splunk-opentelemetry
78+
- key: telemetry.distro.version
79+
value:
80+
stringValue: 2.5.0
4381
- key: service.name
4482
value:
4583
stringValue: python-test
84+
- key: host.arch
85+
value:
86+
stringValue: aarch64
4687
- key: telemetry.auto.version
4788
value:
48-
stringValue: 0.54b1
89+
stringValue: 0.56b0
4990
- key: k8s.pod.ip
5091
value:
5192
stringValue: 10.244.0.12
@@ -265,7 +306,7 @@ resourceSpans:
265306
stringValue: 127.0.0.1
266307
- key: net.peer.port
267308
value:
268-
intValue: "51656"
309+
intValue: "34162"
269310
- key: http.user_agent
270311
value:
271312
stringValue: curl/8.11.1

functional_tests/functional/testdata/python/deployment.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,30 @@ spec:
2020
- image: quay.io/splunko11ytest/python_test:latest
2121
name: python-test
2222
imagePullPolicy: IfNotPresent
23+
command: ["/bin/bash", "-c"]
24+
args:
25+
- |
26+
echo "Installed OpenTelemetry packages:"
27+
pip list | grep opentelemetry || echo "No opentelemetry packages found"
28+
29+
if ! python3 -c "import opentelemetry.instrumentation.flask" 2>/dev/null; then
30+
echo "Flask instrumentation not found, installing..."
31+
pip install --target /usr/local/lib/python3.13/site-packages \
32+
--no-deps \
33+
--disable-pip-version-check \
34+
--root-user-action=ignore \
35+
opentelemetry-instrumentation-flask==0.46b0 \
36+
opentelemetry-instrumentation-wsgi==0.46b0 \
37+
opentelemetry-util-http==0.46b0
38+
if [ $? -eq 0 ]; then
39+
echo "Flask instrumentation installed successfully"
40+
else
41+
echo "Failed to install Flask instrumentation"
42+
fi
43+
else
44+
echo "Flask instrumentation is already available"
45+
fi
46+
47+
exec /start.sh
2348
nodeSelector:
2449
kubernetes.io/os: "linux"

functional_tests/functional/testdata/python/start.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
python3 web.py &
44
pypid=$!
55

6-
76
loop=0
87

98
function stop()

helm-charts/splunk-otel-collector/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ instrumentation:
13361336
# - name: NODEJS_ENV_VAR
13371337
# value: nodejs_value
13381338
python:
1339-
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python:0.54b1
1339+
image: quay.io/signalfx/splunk-otel-instrumentation-python:v2.6.0
13401340
# env:
13411341
# - name: PYTHON_ENV_VAR
13421342
# value: python_value

0 commit comments

Comments
 (0)