-
Notifications
You must be signed in to change notification settings - Fork 857
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
add warning log for extension #11634
base: main
Are you sure you want to change the base?
Conversation
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ExtensionClassLoader.java
Outdated
Show resolved
Hide resolved
if (externalExtensionsLocation != null && !externalExtensionsLocation.isEmpty()) { | ||
List<URL> externalExtensions = parseLocation(externalExtensionsLocation, javaagentFile); | ||
if (externalExtensions.isEmpty()) { | ||
extensionClassLoadWarningMessage = |
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.
when extensionClassLoadWarningMessage
is generated here, can you simply log it right after?
i don't find it necessary to have another static method logWarningIfAny
and call it in AgentStarterImpl
.
unless it's too early because of loggingCustomizer.init(earlyConfig)
?
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.
see the comment above
// this class is used early, and must not use logging in most of its methods
// in case the extension config can not be found, we save the warning
// message and log it later, when the logging subsystem is initialized
if (externalExtensionsLocation != null && !externalExtensionsLocation.isEmpty()) { | ||
List<URL> externalExtensions = parseLocation(externalExtensionsLocation, javaagentFile); | ||
if (externalExtensions.isEmpty()) { | ||
extensionClassLoadWarningMessage = |
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.
see the comment above
// this class is used early, and must not use logging in most of its methods
// in case the extension config can not be found, we save the warning
// message and log it later, when the logging subsystem is initialized
String externalExtensionsLocation = earlyConfig.getString(EXTENSIONS_CONFIG); | ||
if (externalExtensionsLocation != null && !externalExtensionsLocation.isEmpty()) { | ||
List<URL> externalExtensions = parseLocation(externalExtensionsLocation, javaagentFile); | ||
if (externalExtensions.isEmpty()) { |
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.
might be nice to log warning when there are multiple extensions, but one of them is invalid location?
related to #11616