elastic / elastic/apm-agent-java

Consistent annotation behavior without application_packages

Open
#1,502 0 comments 0 reactions 0 assignees View on GitHub
agent-java bug
Dominant language
Java
Stars
594
Forks
338
Avg merge
1d 13h
Merged PRs (30d)
25

Description

## Describe the bug

When using the [public API](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html) annotations, the `application_packages` configuration is required to make them work.

This behavior is not consistent with other similar instrumentation and does not provide a good onboarding experience, as when configuration is missing nothing is instrumented.

For example, Web-services annotated with `@javax.jws.WebService` work out of the box without configuration, the effect of `application_packages` in this case is only to provide better performance as it allows to reduce the search scope for classes that might have the annotation (this search is by definition quite time and resources intensive).

Here, a better behavior would be:
- instrument classes by default, wether `application_packages` is set or not
- make sure that we issue a proper warning when `application_packages` is not set as it implies sub-optimal performance.
- make this behavior consistent on all plugins that relies on annotations.

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.