Skip to content
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

Merged
merged 7 commits into from
May 10, 2021
Merged

Cache default enabled config #2938

merged 7 commits into from
May 10, 2021

Conversation

trask
Copy link
Member

@trask trask commented May 9, 2021

this was made possible by #1643

@trask trask marked this pull request as ready for review May 9, 2021 05:26
Comment on lines 236 to 243
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);
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

@trask
Copy link
Member Author

trask commented May 10, 2021

@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

trask and others added 2 commits May 9, 2021 22:55
…nt/extension/instrumentation/InstrumentationModule.java

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
@iNikem iNikem merged commit edec1bf into open-telemetry:main May 10, 2021
@trask trask deleted the cache-default-enabled-config branch May 10, 2021 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants