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

Improve disableShadowRelocate #9715

Merged
merged 3 commits into from
Oct 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package io.opentelemetry.javaagent.tooling;

import io.opentelemetry.context.Context;
import io.opentelemetry.javaagent.tooling.config.EarlyInitAgentConfig;
import java.io.File;
import java.io.FileOutputStream;
Expand Down Expand Up @@ -164,8 +165,14 @@ private static boolean isJar(File f) {

private static void addFileUrl(List<URL> result, File file) {
try {
URL wrappedUrl = new URL("otel", null, -1, "/", new RemappingUrlStreamHandler(file));
result.add(wrappedUrl);
// skip shading extension classes if opentelemetry-api is not shaded (happens when using
// disableShadowRelocate=true)
if (Context.class.getName().contains("shaded")) {
laurit marked this conversation as resolved.
Show resolved Hide resolved
URL wrappedUrl = new URL("otel", null, -1, "/", new RemappingUrlStreamHandler(file));
result.add(wrappedUrl);
} else {
result.add(file.toURI().toURL());
}
} catch (MalformedURLException ignored) {
System.err.println("Ignoring " + file);
}
Expand Down
Loading