elastic / elastic/apm-agent-java
Limit overhead of trace_methods
- Dominant language
- Java
- Stars
- 594
- Forks
- 338
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 25
Description
When applying the [`trace_methods`](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-trace-methods) configuration option to a large number of methods or event to just one method that is called very often, the performance of the application can severely suffer.
This is a proposal to de-instrument methods that are executing very fast. A good default could be that if a method ever takes less than 10µs, it will be queued for being de-instrumented.
The agent regularly checks the queue and if it's not empty, it un-instruments the registered methods.
There is still overhead involved in instrumenting and de-instrumenting methods and it doesn't solve the underlying problem with trace_methods. Our recommendation would still be to use profiler-inferred spans monitoring a whole codebase in production. But it could make `trace_methods` less dangerous to use.
Contributor guide
Assessment
This issue has not been assessed yet.