elastic / elastic/apm-agent-java

Limit overhead of trace_methods

Open
#1,138 1 comment 1 reaction 0 assignees View on GitHub
enhancement
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

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.