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

Remove IntelliJ debugging agent detection #3315

Merged
merged 2 commits into from Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
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
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