-
Notifications
You must be signed in to change notification settings - Fork 839
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
Cache default enabled config #2938
Cache default enabled config #2938
Conversation
static boolean initDefaultEnabled(Config config) { | ||
return config.getBooleanProperty("otel.instrumentation.common.default-enabled", true); | ||
} | ||
|
||
// visible for testing | ||
static boolean initEnabled( | ||
Config config, List<String> instrumentationNames, boolean defaultEnabled) { | ||
return config.isInstrumentationEnabled(instrumentationNames, defaultEnabled); |
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.
I don't understand why these methods a called init
? They don't initialise anything. I am confused by them
|
||
cleanup: | ||
Config.INSTANCE = null | ||
InstrumentationModule.initDefaultEnabled(config) == enabled |
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.
Is this method called only from test? They I don't see any point in neither the method nor the test.
|
||
cleanup: | ||
Config.INSTANCE = null | ||
InstrumentationModule.initEnabled(config, [name, altName], false) == enabled |
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.
This also does not look like a test for InstrumentationModule
, more like for Config
.
@iNikem I inlined those methods and removed the corresponding tests. Previously I was trying (too hard?) to keep the tests intact, which was the purpose of extracting those methods. PTAL |
...rc/main/java/io/opentelemetry/javaagent/extension/instrumentation/InstrumentationModule.java
Outdated
Show resolved
Hide resolved
…nt/extension/instrumentation/InstrumentationModule.java Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
this was made possible by #1643