Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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 @@ -13,6 +13,13 @@
public class SpringBootApp extends SpringBootServletInitializer {

public static void main(String[] args) {
// Pre-load MethodHandle to avoid ClassCircularityError on Java 17 with runtime attach
// See https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/3396
try {
Class.forName("java.lang.invoke.MethodHandle");
} catch (ClassNotFoundException e) {
// ignore
}
ApplicationInsights.attach();
SpringApplication.run(SpringBootApp.class, args);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ public class SpringBootApp extends SpringBootServletInitializer {
private static final String FAKE_INGESTION_ENDPOINT = "http://host.testcontainers.internal:6060/";

public static void main(String[] args) {
// Pre-load MethodHandle to avoid ClassCircularityError on Java 17 with runtime attach
// See https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/3396
try {
Class.forName("java.lang.invoke.MethodHandle");
} catch (ClassNotFoundException e) {
// ignore
}
ApplicationInsights.attach();
ConnectionString.configure(
"InstrumentationKey=00000000-0000-0000-0000-0FEEDDADBEEF;IngestionEndpoint="
Expand Down