-
Couldn't load subscription status.
- Fork 561
Fix: variable propagation priority in Instrumentation CR. #4324
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
base: main
Are you sure you want to change the base?
Conversation
|
Important Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services. |
34f6520 to
5880a9e
Compare
5880a9e to
3491bc1
Compare
4ca1b3f to
79311a7
Compare
|
Is fixing this for Python enough? Do other languages do the right thing already? |
79311a7 to
4eb4c8c
Compare
|
Hey @frzifus can you verify running the e2e-instrumentation locally ?not sure i think its due to the sidecar changes Latest commit : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes incorrect environment variable precedence in the Instrumentation CR, ensuring that variables defined under spec.env correctly override default instrumentation settings. Previously, global environment variables were ignored unless overridden in language-specific sections.
- Refactors environment variable injection to establish proper precedence: language-specific env vars > spec.env > defaults
- Introduces new
injectDefaultEnvVarsmethod to centralize default environment variable management - Prevents modification of environment variables that use
ValueFromreferences
Reviewed Changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/instrumentation/sdk.go | Adds new method for default env var injection and modifies existing injection flow |
| internal/instrumentation/python.go | Moves Python default env vars to separate function and removes inline injection |
| internal/instrumentation/nodejs.go | Extracts Node.js default env vars to separate function with ValueFrom protection |
| internal/instrumentation/javaagent.go | Moves Java agent defaults to separate function with ValueFrom protection |
| internal/instrumentation/dotnet.go | Extracts .NET default env vars to separate function with ValueFrom protection |
| tests/e2e-instrumentation/* | Updates test expectations to reflect new environment variable ordering |
| internal/instrumentation/*_test.go | Modifies unit tests to verify new injection behavior |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…ectly over defaults Signed-off-by: Praful Khanduri <holiodin@gmail.com>
…gation fix Signed-off-by: Praful Khanduri <holiodin@gmail.com>
85afb82 to
332f3fe
Compare
|
Hey folks, could you please review the changes when you get a chance! |
…nvs at last Signed-off-by: Praful Khanduri <holiodin@gmail.com> fix(auto-instrumentation): updated nodejs & javaagent for propagate the default envs at last Signed-off-by: Praful Khanduri <holiodin@gmail.com> test(auto-instrumentation): updated e2e & unit tests Signed-off-by: Praful Khanduri <holiodin@gmail.com
332f3fe to
cdde0ac
Compare
|
cc @frzifus |
|
I’d really appreciate it if anyone could review. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Given the size and potential for breakage in this change, I'd prefer if another maintainer reviewed this PR before we merge. @jaronoff97 you had plans for refactoring instrumentation injection, can you check if this change interferes with that?
Description:
Fixes incorrect environment variable propagation priority in the Instrumentation CR. Previously, environment variables defined under
spec.envwere ignored in favor of instrumentation defaults, unless overridden in language-specific sections.This ensures users can define global environment variables in one place without duplicating them per language.
Link to tracking Issue(s):
Testing:
Documentation: