elastic / elastic/apm-agent-java

Ignore agent internal classes for instrumentation

Open
#1,573 0 comments 0 reactions 0 assignees View on GitHub
agent-java
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.