# Tracer in libbeat is always enabled

**URL:** <https://discuss.elastic.co/t/tracer-in-libbeat-is-always-enabled/245742>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [August 20, 2020, 10:22am UTC](https://discuss.elastic.co/t/tracer-in-libbeat-is-always-enabled/245742 "2020-08-20T10:22:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![newly](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@newly](https://discuss.elastic.co/u/newly)\
**Post date:** [August 20, 2020, 10:22am UTC](https://discuss.elastic.co/t/tracer-in-libbeat-is-always-enabled/245742/1 "2020-08-20T10:22:36Z")

</div>

[here](https://github.com/elastic/beats/blob/master/libbeat/instrumentation/instrumentation.go#L52-L59) the tracer will always be given `apm.DefaultTracer`, hence [these statements](https://github.com/elastic/beats/blob/master/libbeat/publisher/pipeline/output.go#L170-L175) are always reached, and `apm.DefaultTracer` seems not to be fully disabled.  
while we don't have apm server setup/configured, `StartTransaction` seems to have no effect, and it seems that it uses 5~10% memory.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/1/61c7717ab2228b8192a17aa4e6a25905c2afef11.png)

---

<div class="post-metadata">

**Author:** ![newly](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@newly](https://discuss.elastic.co/u/newly)\
**Post date:** [August 26, 2020, 4:31am UTC](https://discuss.elastic.co/t/tracer-in-libbeat-is-always-enabled/245742/2 "2020-08-26T04:31:45Z")

</div>

Hi,  
could someone please suggest on this?

---

<div class="post-metadata">

**Author:** ![jalvz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jalvz/32/45613_2.png) [@jalvz](https://discuss.elastic.co/u/jalvz)\
**Post date:** [August 27, 2020, 8:59am UTC](https://discuss.elastic.co/t/tracer-in-libbeat-is-always-enabled/245742/3 "2020-08-27T08:59:16Z")

</div>

Hello there,

Sorry for the issue, and thanks for reporting!

We will put a fix for this in the next version.

In the meanwhile, might I ask if you are running in a memory-constrained environment? Does your process takes around ~50-100Mb during normal operation, or does that flame graph comes from a test environment or similar?  
(We'll fix anyways, just trying to understand the use case and severity of this)

---

<div class="post-metadata">

**Author:** ![newly](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@newly](https://discuss.elastic.co/u/newly)\
**Post date:** [September 1, 2020, 12:21am UTC](https://discuss.elastic.co/t/tracer-in-libbeat-is-always-enabled/245742/4 "2020-09-01T00:21:52Z")

</div>

Thanks for the follow up.  
The flame graph comes from testing environment. It was noticed with a large amount of metrics to be scrapped, metricbeat could be OOMkilled(running as systemd service and limited by cgroup), so we were trying to figure out how memory are used and noticed this problem.  
Was there a github issue that I need to follow as well?

---

<div class="post-metadata">

**Author:** ![jalvz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jalvz/32/45613_2.png) [@jalvz](https://discuss.elastic.co/u/jalvz)\
**Post date:** [September 1, 2020, 9:27am UTC](https://discuss.elastic.co/t/tracer-in-libbeat-is-always-enabled/245742/5 "2020-09-01T09:27:33Z")

</div>

Hello,

Yes, I filed an issue here [https://github.com/elastic/apm-agent-go/issues/809](https://github.com/elastic/apm-agent-go/issues/809), and a quick fix in Beats in [https://github.com/elastic/beats/pull/20852](https://github.com/elastic/beats/pull/20852)

---

<div class="post-metadata">

**Author:** ![newly](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@newly](https://discuss.elastic.co/u/newly)\
**Post date:** [September 1, 2020, 9:32am UTC](https://discuss.elastic.co/t/tracer-in-libbeat-is-always-enabled/245742/6 "2020-09-01T09:32:06Z")

</div>

That's great. thanks a lot!

---

<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:** [September 29, 2020, 11:32am UTC](https://discuss.elastic.co/t/tracer-in-libbeat-is-always-enabled/245742/7 "2020-09-29T11:32:14Z")

</div>

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