opentelemetry-operator
opentelemetry-operator copied to clipboard
Set environment variables only not work
I want Set environment variables without injection sdk, I use config below as a Instrumentation
:
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
name: opentelemetry-autoinstrumentation
spec:
java:
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-java
nodejs:
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-nodejs
python:
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python
dotnet:
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-dotnet
env:
- name: OTEL_SERVICE_NAME
value: my-app
sampler:
type: always_on
the deployment with annotation:
annotations:
instrumentation.opentelemetry.io/inject-sdk: 'true'
after the Pod restart, I don't find the expect env in container object, is there some wrong in my config? By the way, I don't find any log about inject env in manager's container
The annotation instrumentation.opentelemetry.io/inject-sdk: 'true'
has to be put in the pod spec inside deployment not in the deployment annotations. To verify could you please paste here full deployment spec?
cc) @Frapschen
Confirmed: I just upgrade to 0.56.0 to test the inject-sdk feature. When I use inject-sdk: 'namespace/my-inst'
no variables are injected, but when I changed sdk
to java
it works, so the annotation is in the right spot, and the manager is working.
Scratch that, it works, it's just not released yet 😆 0.56.0 only has commits from 16 days ago, but the inject-sdk went in 14 days ago. Weird that it's mentioned in the docs already, but anyway - if you need it today, you can use ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator@sha256:2bab7a2dd5f7aee9dabdf85cd040d3bcd3fc29a4175260bd385d8bd5bc75963a
in the manifests
ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator@sha256:2bab7a2dd5f7aee9dabdf85cd040d3bcd3fc29a4175260bd385d8bd5bc75963a
thx, It works!
Closing, please re-open if there will be still the issue in 0.57.x