elastic / apm-agent-java

https://www.elastic.co/guide/en/apm/agent/java/current/index.html
Apache License 2.0
567 stars 320 forks source link

Exclude agent plugins from instrumentation #2757

Open SylvainJuge opened 2 years ago

SylvainJuge commented 2 years ago

This is a follow-up issue of #2724, where the issue was excluding the ECS logging instrumentation for the internal copy of ECS logging within the agent (thus loaded within agent/internal plugin classloader), but not the one that might be present in the application.

Classes that are loaded by the internal plugin classloader do not need to be instrumented and should thus be excluded from instrumentation.

See https://github.com/elastic/apm-agent-java/pull/2724#discussion_r951727013 for hints on why this might be required.

For external plugins, instrumentation is required in order to allow the agent to delegate to internal tracer.

Few ideas that needs to be explored:

jackshirazi commented 2 years ago

maybe worth having that on a property, there's a scenario where a customer wants to use an external plugin to adjust internally loaded instrumentation