-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NodeJS Auto instrumentation overrides NODE_OPTIONS when defined from ConfigMap #1393
Comments
We need to enable the |
Our workaround was to define such variables directly in the POD's Env, not in EnvFrom ConfigMap, this is what OTEL Operator could read. I prepared a fix for this in #3373. OTEL Operator is now able to see environment variables also in ConfigMaps and Secrets, so it can correctly append to it. |
Description
I have a node container for which I use the env var
NODE_OPTIONS
However, it is defined via a ConfigMap under
containers[0].envFrom
and notcontainers[0].env
The NodeJS auto instrumentation modifies the pod to and sets
NODE_OPTIONS
value undercontainers[0].env
to the default value (--require /otel-auto-instrumentation/autoinstrumentation.js
) instead of concatenating it like it should.I have found [https://github.com//issues/1094](this issue). To my understanding, the operator checks only the
containers.env
property and notenvFrom
, which results in this conjestion.Though I know I can manually set the
NODE_OPTIONS
env undercontainers.env
and it would probably work, I need my env variables to be managed withenvFrom
, and I don't think overriding these vars is the right behaviour for the operator.Steps to Reproduce
Create a NodeJS pod and a ConfigMap containing
NODE_OPTIONS
key and some value in it.Instrument the pod using the operator auto instrumentation.
Expected Result
The instrumentation
NODE_OPTIONS
should be concatenated with mine.Actual Result
The instrumentation
NODE_OPTIONS
overrides mine.The text was updated successfully, but these errors were encountered: