elastic / elastic/apm-agent-java
Ignore agent internal classes for instrumentation
- Dominant language
- Java
- Stars
- 594
- Forks
- 338
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 25
Description
Some agent classes are eligible for instrumentation, which makes the agent able to self-instrument even if that feature is not used in practice.
One example of such classes is `co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.FlushOnTimeoutTimerTask` that is instrumented by the [scheduled-annotation-plugin](https://github.com/elastic/apm-agent-java/blob/master/apm-agent-plugins/apm-scheduled-annotation-plugin/src/main/java/co/elastic/apm/agent/scheduled/TimerTaskInstrumentation.java) . As a result, this class may appear as a transaction on APM dashboard.
Given there is no actual need to self-instrument the agent itself, we should probably avoid classes in the agent package.
One exception though is that agent API is required to be instrumented by the agent.
Proposal:
- package `co.elastic.apm.agent` (and sub-packages) should not be instrumented
- package `co.elastic.apm.api` (and sub-packages) should be instrumented
Contributor guide
Assessment
This issue has not been assessed yet.