-
Notifications
You must be signed in to change notification settings - Fork 619
fix: enable programmatic config when environment variables are unset #2947
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
fix: enable programmatic config when environment variables are unset #2947
Conversation
| disabledInstrumentationsFromEnv.includes(name) | ||
| ) { | ||
| diag.debug(`Disabling instrumentation for ${name}`); | ||
| // Configuration priority: Environment variables > programmatic config |
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.
There isn't a clear guideline of what takes precedent (env or programmatic), but in the JS SDK we have been using
programmatic > env
so to keep consistency across the SDK, I would suggest you make the changes accordingly here
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.
maryliag
left a comment
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.
Thank you for the changes!
|
Thank you for your contribution @YangJonghun! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
Which problem is this PR solving?
fs) regardless of environment variable settingsShort description of the changes
userConfig.enabledis now checked first, before any environment variable logicConfiguration Priority (after changes):
userConfig.enabled: true/false) - highest priority, always respectedOTEL_NODE_DISABLED_INSTRUMENTATIONS,OTEL_NODE_ENABLED_INSTRUMENTATIONS) - used when programmatic config is not setdefaultExcludedInstrumentations) - applied when neither programmatic config nor env vars are set