# Adding context to trace name?

**URL:** <https://discuss.elastic.co/t/adding-context-to-trace-name/219559>\
**Category:** APM\
**Tags:** ui\
**Created:** [February 17, 2020, 3:38am UTC](https://discuss.elastic.co/t/adding-context-to-trace-name/219559 "2020-02-17T03:38:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![baerrach](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baerrach/32/48119_2.png) [@baerrach](https://discuss.elastic.co/u/baerrach)\
**Post date:** [February 17, 2020, 3:38am UTC](https://discuss.elastic.co/t/adding-context-to-trace-name/219559/1 "2020-02-17T03:38:04Z")

</div>

**Kibana version** :  
v7.5.0

**Elasticsearch version** :  
v7.5.0

**APM Server version** :  
v7.5.0

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

I'm building a custom command line and integrating it with Elastic APM, but this problem would also be relevant to Web frameworks as well.

When I build the distributed trace I am following the [naming recommendations](https://www.elastic.co/guide/en/apm/get-started/current/transactions.html) of transactions:

> `name` should be a generic designation of a transaction in the scope of a single service, e.g. `GET /users/:id` , `UsersController#show` , etc.

In the Kibana UI the transactions are then listed as `GET /users/:id`.

In a hypothetical distributed trace that has many of these transactions it is impossible to visually see which transaction has the `:id` that you are interested in.

To find that transaction the user must click on each transaction and open the "Transaction details" overlay, scroll down to "Custom" (or other header), locate the key and look at the value.

What I would like the Kibana display to show is `GET /users/:id {id=42)`, so that I can visually locate the correct transaction in the trace.

Is this possible at all?

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [February 18, 2020, 8:48am UTC](https://discuss.elastic.co/t/adding-context-to-trace-name/219559/2 "2020-02-18T08:48:00Z")

</div>

What you could do is to add a label like `span.addLabel("id", 42)`. Then you can search in the UI for `labels.id : 42` to only see transactions with this ID.

---

<div class="post-metadata">

**Author:** ![baerrach](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baerrach/32/48119_2.png) [@baerrach](https://discuss.elastic.co/u/baerrach)\
**Post date:** [February 18, 2020, 9:07am UTC](https://discuss.elastic.co/t/adding-context-to-trace-name/219559/3 "2020-02-18T09:07:01Z")

</div>

I'm not looking to search.

I'm just viewing the timeline of the transactions.  
It'd be nice if some context was available in the title of the transaction/span as per the original description.

The title has the slug `:id` in it, it should be able to pull that value out of the custom context or predefined fields.

---

<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:** [March 10, 2020, 5:09am UTC](https://discuss.elastic.co/t/adding-context-to-trace-name/219559/4 "2020-03-10T05:09:26Z")

</div>

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