Not able to integrate async-profiler with the Elastic APM agent

247 Views Asked by At

I want to collect native threads information through APM. APM configuration tracks only Transactions and not java threads. As per documentation, i need to enable async-profiler as below. Added these in elasticapm.properties file.

profiling_inferred_spans_enabled=true
profiling_inferred_spans_sampling_interval=50ms
profiling_inferred_spans_min_duration=250ms
profiling_inferred_spans_logging_enabled=true
profiling_inferred_spans_lib_directory=/opt/async-profiler-2.9-linux-x64/build/libasyncProfiler.so

I have started my app with below startup arguments..

-javaagent:/opt/trade/elastic-apm-agent.jar -Delastic.apm.service_name=TAETFDemoApp -Delastic.apm.server_url=http://xxxxxx:8200 -Delastic.apm.config_file=/opt/trade/elasticapm.properties 

Able to capture all transactions data, still not able to get native threads and cpu profiling details? Any help would be appreciated?

I have started my app with below startup arguments..

-javaagent:/opt/trade/elastic-apm-agent.jar -Delastic.apm.service_name=TAETFDemoApp -Delastic.apm.server_url=http://xxxxxx:8200 -Delastic.apm.config_file=/opt/trade/elasticapm.properties 

Able to capture all transactions data, still not able to get native threads and cpu profiling details? Any help would be appreciated?

1

There are 1 best solutions below

0
On

The async-profiler in the Elastic Java APM Agent is primarily used for the inferred spans feature described here. So what it'll do is that it'll create spans in an APM transaction based on the set of stack traces captured by the async-profiler. It's important to note, that it'll still behave as an APM Agent and not like a profiler. So it won't show you a full thread dump and it does not show every single method which is present on the stack traces.

However, there is another Elastic product exactly for what you'd want to achieve: it's the Elastic Universal Profiling - this is not part of APM, so you'd install this additionally to the APM Agent. More info on it can be found here and here and here.