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

Don't pass configuration to SDK autoconfigure through system props #3866

Merged

Conversation

mateuszrzeszutek
Copy link
Member

No description provided.


/**
* Returns a boolean-valued configuration property or {@code defaultValue} if a property with name
* {@code name} has not been configured.
*/
public boolean getBooleanProperty(String name, boolean defaultValue) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning to rename all get*Property() methods to get*() in the next PR - those shorter names seem a bit nicer, and they're consistent with the SDK ConfigProperties interface too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the plan to have this implement ConfigProperties then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately that won't be possible with the current shape of this repo: instrumentation-api only uses OTel API, not the SDK, so we can't directly implement the ConfigProperties interface here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok then. makes sense!

Comment on lines -85 to -92
allProperties.forEach(
(key, value) -> {
if (!environmentProperties.containsKey(key)
&& key.startsWith("otel.")
&& !key.startsWith("otel.instrumentation")) {
System.setProperty(key, value);
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@trask trask merged commit ca8a119 into open-telemetry:main Aug 19, 2021
@mateuszrzeszutek mateuszrzeszutek deleted the remove-system-properties-hack branch August 23, 2022 13:37
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