# Implement Async profiler with elastic APM

**URL:** <https://discuss.elastic.co/t/implement-async-profiler-with-elastic-apm/343495>\
**Category:** APM\
**Tags:** java\
**Created:** [September 21, 2023, 1:24am UTC](https://discuss.elastic.co/t/implement-async-profiler-with-elastic-apm/343495 "2023-09-21T01:24:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![senyam08](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/senyam08/32/106230_2.png) [@senyam08](https://discuss.elastic.co/u/senyam08)\
**Post date:** [September 21, 2023, 1:24am UTC](https://discuss.elastic.co/t/implement-async-profiler-with-elastic-apm/343495/1 "2023-09-21T01:24:30Z")

</div>

Could you help with setting up async profiler to use with APM Java agent.

I have following properties added

```auto
profiling_inferred_spans_enabled=true
profiling_inferred_spans_sampling_interval=50ms
profiling_inferred_spans_min_duration=150ms
profiling_inferred_spans_logging_enabled=true

Do i need to download asyncprofiler latest version and add it container with following? 

profiling_inferred_spans_lib_directory=/opt/async-profiler-2.9-linux-x64/build/libasyncProfiler.so

```

Thanks  
Senthil

---

<div class="post-metadata">

**Author:** ![Jack\_Shirazi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_shirazi/32/91641_2.png) [@Jack\_Shirazi](https://discuss.elastic.co/u/Jack_Shirazi)\
**Post date:** [September 21, 2023, 9:47am UTC](https://discuss.elastic.co/t/implement-async-profiler-with-elastic-apm/343495/2 "2023-09-21T09:47:56Z")

</div>

The

> [@senyam08](#):
>
> ```auto
> Do i need to download asyncprofiler latest version and add it container with following? 
> 
> ```

No, the profiler is already distributed with the agent (for common linux hosts/VMs). It should just be working and giving you inferred spans with those options

There is no need to define the `profiling_inferred_spans_lib_directory` and definitely not for a different version of the asyncprofiler, that will cause problems. It's intended to point to a writeable temp dir

---

<div class="post-metadata">

**Author:** ![senyam08](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/senyam08/32/106230_2.png) [@senyam08](https://discuss.elastic.co/u/senyam08)\
**Post date:** [September 21, 2023, 1:31pm UTC](https://discuss.elastic.co/t/implement-async-profiler-with-elastic-apm/343495/3 "2023-09-21T13:31:50Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 19, 2023, 1:32pm UTC](https://discuss.elastic.co/t/implement-async-profiler-with-elastic-apm/343495/4 "2023-10-19T13:32:44Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
