Skip to content

Commit

Permalink
Remove IntelliJ debugging agent detection (#3315)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKunz authored Sep 12, 2023
1 parent 71fdc37 commit 70dda49
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<? super TypeDescription> getTypeMatcher() {
return is(ForkJoinTask.class);
Expand Down

0 comments on commit 70dda49

Please sign in to comment.