# Explore: How to associate APM tracking with logs

**URL:** <https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951>\
**Category:** APM\
**Tags:** go\
**Created:** [September 18, 2019, 8:41am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951 "2019-09-18T08:41:07Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![EDDYCJY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddycjy/32/54324_2.png) [@EDDYCJY](https://discuss.elastic.co/u/EDDYCJY)\
**Post date:** [September 18, 2019, 8:41am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/1 "2019-09-18T08:41:07Z")

</div>

I have an idea now, I want to associate APM tracking with its corresponding log, but I don't know if there is any good way, very distressed.

What I am looking for is that when I look at the RPC method of a link trace, I click on it and I can see the corresponding business log information (with trace\_id).

 ![1568796030080](https://us1.discourse-cdn.com/elastic/original/3X/9/4/94a410d868ff380d2a381722a1dd917ce4631af3.jpeg)

---

<div class="post-metadata">

**Author:** ![EDDYCJY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddycjy/32/54324_2.png) [@EDDYCJY](https://discuss.elastic.co/u/EDDYCJY)\
**Post date:** [September 18, 2019, 8:47am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/2 "2019-09-18T08:47:16Z")

</div>

@axw I want to assemble Elastic APM into a full-link system in business. I don't need to manually search for it, but jump or display related information directly, thank you.

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [September 18, 2019, 9:12am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/3 "2019-09-18T09:12:04Z")

</div>

Have you seen the blog post I wrote earlier this year, "How to instrument your Go app with the Elastic APM Go agent"? There is a section about integrating logs: [https://www.elastic.co/blog/how-to-instrument-your-go-app-with-the-elastic-apm-go-agent#logs](https://www.elastic.co/blog/how-to-instrument-your-go-app-with-the-elastic-apm-go-agent#logs)

With APM UI 7.3.0+, you can already link from transactions/traces to logs:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/9/6930d0413c7527bd9b9bd6c0eca23a551190793f.png)

Clicking "Show trace logs" will take you to the Logs app, filtered to the selected transaction's trace.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/8/18187522cc4731134df8f39bd9264837376ad4e9.png)

---

<div class="post-metadata">

**Author:** ![EDDYCJY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddycjy/32/54324_2.png) [@EDDYCJY](https://discuss.elastic.co/u/EDDYCJY)\
**Post date:** [September 19, 2019, 2:10am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/4 "2019-09-19T02:10:02Z")

</div>

Thanks, I will check it out later.  
But we are currently using 6.6.1, it seems that we can't upgrade to 7.3.0 seamlessly?

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [September 19, 2019, 2:49am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/5 "2019-09-19T02:49:16Z")

</div>

Not directly from 6.6.1 to 7.3.0. You would need to upgrade from 6.6.1 to 6.8.0, and then from 6.8.0 to 7.3.2. See [https://www.elastic.co/guide/en/elastic-stack/current/upgrading-elastic-stack.html](https://www.elastic.co/guide/en/elastic-stack/current/upgrading-elastic-stack.html)

---

<div class="post-metadata">

**Author:** ![EDDYCJY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddycjy/32/54324_2.png) [@EDDYCJY](https://discuss.elastic.co/u/EDDYCJY)\
**Post date:** [September 20, 2019, 3:29am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/6 "2019-09-20T03:29:37Z")

</div>

I am thinking that it will be very troublesome to upgrade the version each time you use a new feature.

In addition, I would like to ask if there is a custom page in es?

---

<div class="post-metadata">

**Author:** ![EDDYCJY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddycjy/32/54324_2.png) [@EDDYCJY](https://discuss.elastic.co/u/EDDYCJY)\
**Post date:** [September 20, 2019, 3:45am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/7 "2019-09-20T03:45:19Z")

</div>

Where can I see the latest plan of APM? Because our company is using it, I feel very good. I also want to write an article to recommend to Go developers in the Chinese community.

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [September 20, 2019, 4:00am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/8 "2019-09-20T04:00:33Z")

</div>

> [@EDDYCJY](#):
>
> In addition, I would like to ask if there is a custom page in es?

A custom page for what? Logs? If that's what you mean, there is a Logs app: [Observability | Kibana Guide [8.11] | Elastic](https://www.elastic.co/guide/en/kibana/current/xpack-logs.html)

> [@EDDYCJY](#):
>
> Where can I see the latest plan of APM? Because our company is using it, I feel very good. I also want to write an article to recommend to Go developers in the Chinese community.

That would be great!

I assume by "plan" you're referring to our roadmap? We don't have a public roadmap, as it may change. However, you can find many of our planned features at [Issues · elastic/apm · GitHub](https://github.com/elastic/apm/issues).

---

<div class="post-metadata">

**Author:** ![EDDYCJY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddycjy/32/54324_2.png) [@EDDYCJY](https://discuss.elastic.co/u/EDDYCJY)\
**Post date:** [September 20, 2019, 6:41am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/9 "2019-09-20T06:41:12Z")

</div>

Thanks for your reply, I am testing 7.3.2, but I found that Transactions have no Time spent by span type chart, as follows:

 ![1568961464993](https://us1.discourse-cdn.com/elastic/original/3X/2/0/207a88d9e4424b170b199da1fd7ee7ccddb1d5c5.jpeg)

 ![1568961618871](https://us1.discourse-cdn.com/elastic/original/3X/3/5/359ef3555ea163a6b143dfb071a77c98c2a25d8e.jpeg)

Expected result:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/e/b/eb8c906985e515dea593b62837e6165be7026bb5.png)

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [September 20, 2019, 6:54am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/10 "2019-09-20T06:54:19Z")

</div>

Which version of the Go agent are you using? This feature was added to the Go agent in [v1.5.0](https://github.com/elastic/apm-agent-go/blob/master/CHANGELOG.md#v150).

---

<div class="post-metadata">

**Author:** ![EDDYCJY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddycjy/32/54324_2.png) [@EDDYCJY](https://discuss.elastic.co/u/EDDYCJY)\
**Post date:** [September 20, 2019, 7:51am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/11 "2019-09-20T07:51:31Z")

</div>

I just used version 1.4.0 and it is now resolved after the upgrade.

I feel that the documentation has a weak description of the version declaration, for example: [https://www.elastic.co/guide/en/elastic-stack/current/apm-highlights.html#\_aggregate\_service\_breakdown\_charts](https://www.elastic.co/guide/en/elastic-stack/current/apm-highlights.html#_aggregate_service_breakdown_charts), and does not specify the version requirements.

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [September 20, 2019, 7:53am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/12 "2019-09-20T07:53:37Z")

</div>

Thanks for the feedback - I agree, this could be clearer. I'll see if we can get this documented, at least for features we add in the future if not this one.

---

<div class="post-metadata">

**Author:** ![EDDYCJY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddycjy/32/54324_2.png) [@EDDYCJY](https://discuss.elastic.co/u/EDDYCJY)\
**Post date:** [September 23, 2019, 1:13pm UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/13 "2019-09-23T13:13:49Z")

</div>

emememem...What should I do if I have multiple loggers?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/f/2fe48a45d22fb2c14e91cc21a804fabe8c46280c.png)

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [September 23, 2019, 1:27pm UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/14 "2019-09-23T13:27:30Z")

</div>

The call to `apm.DefaultTracer.SetLogger` is only used for logging what the agent is doing. It's not required for adding trace IDs to logs.

---

<div class="post-metadata">

**Author:** ![EDDYCJY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddycjy/32/54324_2.png) [@EDDYCJY](https://discuss.elastic.co/u/EDDYCJY)\
**Post date:** [September 25, 2019, 3:07am UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/15 "2019-09-25T03:07:21Z")

</div>

I have run successfully, thank you very much for your reply, I will consider promoting the upgrade of the new version and the use of log link tracking.

---

<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 15, 2019, 11:17pm UTC](https://discuss.elastic.co/t/explore-how-to-associate-apm-tracking-with-logs/199951/16 "2019-10-15T23:17:57Z")

</div>

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