From 70dda49fd35e740e6078c8067e0e2d0f9dd661a6 Mon Sep 17 00:00:00 2001 From: Jonas Kunz Date: Tue, 12 Sep 2023 11:05:34 +0200 Subject: [PATCH] Remove IntelliJ debugging agent detection (#3315) --- CHANGELOG.asciidoc | 1 + .../agent/concurrent/ForkJoinTaskInstrumentation.java | 11 ----------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 99c9032d4f..16c9c335e1 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -44,6 +44,7 @@ Use subheadings with the "=====" level for adding notes for unreleased changes: * Added `baggage_to_attach` config option to allow automatic lifting of baggage into transaction, span and error attributes - {pull}3288[#3288], {pull}3289[#3289] * Exclude elasticsearch 8.10 and newer clients from instrumentation because they natively support OpenTelemetry - {pull}3303[#3303] * Switched to OpenTelemetry compatible context propagation for Kafka - {pull}3300[#3300] +* Allow running the IntelliJ debug agent in parallel - {pull}3315[#3315] [[release-notes-1.x]] === Java Agent version 1.x diff --git a/apm-agent-plugins/apm-java-concurrent-plugin/src/main/java/co/elastic/apm/agent/concurrent/ForkJoinTaskInstrumentation.java b/apm-agent-plugins/apm-java-concurrent-plugin/src/main/java/co/elastic/apm/agent/concurrent/ForkJoinTaskInstrumentation.java index a2648cece9..1c5a0ee0f1 100644 --- a/apm-agent-plugins/apm-java-concurrent-plugin/src/main/java/co/elastic/apm/agent/concurrent/ForkJoinTaskInstrumentation.java +++ b/apm-agent-plugins/apm-java-concurrent-plugin/src/main/java/co/elastic/apm/agent/concurrent/ForkJoinTaskInstrumentation.java @@ -42,17 +42,6 @@ public class ForkJoinTaskInstrumentation extends ElasticApmInstrumentation { private static final Tracer tracer = GlobalTracer.get(); - static { - if (Boolean.parseBoolean(System.getProperty("intellij.debug.agent"))) { - // IntelliJ debugger also instrument some java.util.concurrent classes and changes the class structure. - // However, the changes are not re-applied when re-transforming already loaded classes, which makes our - // agent unable to see those structural changes and try to load classes with their original bytecode - // - // Go to the following to enable/disable: File | Settings | Build, Execution, Deployment | Debugger | Async Stack Traces - throw new IllegalStateException("IntelliJ debug agent detected, disable it to prevent unexpected instrumentation errors. See https://github.com/elastic/apm-agent-java/issues/1673"); - } - } - @Override public ElementMatcher getTypeMatcher() { return is(ForkJoinTask.class);