# APM UI - Not able to search for child span/transaction labels

**URL:** <https://discuss.elastic.co/t/apm-ui-not-able-to-search-for-child-span-transaction-labels/294081>\
**Category:** APM\
**Tags:** ui\
**Created:** [January 11, 2022, 9:29pm UTC](https://discuss.elastic.co/t/apm-ui-not-able-to-search-for-child-span-transaction-labels/294081 "2022-01-11T21:29:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eduhenke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eduhenke/32/100162_2.png) [@eduhenke](https://discuss.elastic.co/u/eduhenke)\
**Post date:** [January 11, 2022, 9:29pm UTC](https://discuss.elastic.co/t/apm-ui-not-able-to-search-for-child-span-transaction-labels/294081/1 "2022-01-11T21:29:34Z")

</div>

**Kibana version** : 7.15.1

**Elasticsearch version** : 7.15.1

**APM Server version** : 7.15.1

**APM Agent language and version** : Node.JS at 3.26.0

**Browser version** : Chrome

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: Docker

**Fresh install or upgraded from other version?** Fresh install

**Is there anything special in your setup?** Not that I can think of, just a simple docker-compose

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

I expected to be able to filter traces based on their transactions' labels. However as shown below I am not able to do that.

With the following **distributed** transaction:

 ![Screenshot from 2022-01-11 18-20-01](https://us1.discourse-cdn.com/elastic/original/3X/e/a/eaca6b15b8d3f47a7413ecd94d4b89b3fc877f16.png)

When I see the child transaction from the "station-write" service, we can see that there is a "stationId" label:

 ![Screenshot from 2022-01-11 18-20-14](https://us1.discourse-cdn.com/elastic/original/3X/4/5/456c9fa6546d49300b4f16fe742a448ad47f8b71.png)

When I see the parent transaction from the "gateway" service, we can see that there are other labels:

 ![Screenshot from 2022-01-11 18-20-30](https://us1.discourse-cdn.com/elastic/original/3X/1/0/1060a54b8f85fd9eab8636f43a0df08acc1534fc.png)

**Steps to reproduce** :

1. Go to "Traces" page, enter in the search box the "labels.stationId" field(we can see that the auto complete works):  

2. Filter by a given value, and see that it doesn't show any transactions  

I couldn't find anywhere that said that it is(or is not) possible to search by labels in child spans/transactions. If it isn't possible to search by those labels, is there any way that I can add those labels to the parent transaction, in order for them to be searchable? The gateway service starts the trace, and this "station-write" service creates another transaction inside of that distributed trace(they are in different pods).

**Errors in browser console (if relevant)**:

**Provide logs and/or server output (if relevant)**:

---

<div class="post-metadata">

**Author:** ![eduhenke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eduhenke/32/100162_2.png) [@eduhenke](https://discuss.elastic.co/u/eduhenke)\
**Post date:** [January 24, 2022, 6:17pm UTC](https://discuss.elastic.co/t/apm-ui-not-able-to-search-for-child-span-transaction-labels/294081/2 "2022-01-24T18:17:13Z")

</div>

this is still a problem for me

---

<div class="post-metadata">

**Author:** ![dgieselaar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dgieselaar/32/46947_2.png) [@dgieselaar](https://discuss.elastic.co/u/dgieselaar)\
**Post date:** [January 26, 2022, 4:09pm UTC](https://discuss.elastic.co/t/apm-ui-not-able-to-search-for-child-span-transaction-labels/294081/3 "2022-01-26T16:09:56Z")

</div>

@eduhenke it is indeed not possible to search by child spans. One workaround we have today is to make sure those labels are added to the transaction as well. Alternatively, you can use Discover to look for spans that match your search, and copy the trace/transaction id. You can then use those as a filter in the APM UI.

---

<div class="post-metadata">

**Author:** ![eduhenke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eduhenke/32/100162_2.png) [@eduhenke](https://discuss.elastic.co/u/eduhenke)\
**Post date:** [January 26, 2022, 5:35pm UTC](https://discuss.elastic.co/t/apm-ui-not-able-to-search-for-child-span-transaction-labels/294081/4 "2022-01-26T17:35:19Z")

</div>

Hi @dgieselaar, thanks for answering!

I understood that I can't search by the child spans, however the search also doesn't work with distributed transactions. It is from my understanding that the child transaction created in a microservice and linked with another parent transaction(maybe coming from a gateway in front of that microservice), is indeed a transaction. However I can't search for that child transaction as well. Is that behavior also expected?

---

<div class="post-metadata">

**Author:** ![dgieselaar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dgieselaar/32/46947_2.png) [@dgieselaar](https://discuss.elastic.co/u/dgieselaar)\
**Post date:** [February 3, 2022, 2:58pm UTC](https://discuss.elastic.co/t/apm-ui-not-able-to-search-for-child-span-transaction-labels/294081/5 "2022-02-03T14:58:12Z")

</div>

> [@eduhenke](#):
>
> I understood that I can't search by the child spans, however the search also doesn't work with distributed transactions. It is from my understanding that the child transaction created in a microservice and linked with another parent transaction(maybe coming from a gateway in front of that microservice), is indeed a transaction. However I can't search for that child transaction as well. Is that behavior also expected?

@eduhenke This is not possible in the traces overview, which only lists root transactions (ie transactions without a parent). However, in this scenario I think you could possibly use the services overview to filter for the child transaction. Would that work for you? (And apologies for the late reply, this dropped off my radar).

---

<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:** [February 24, 2022, 10:58am UTC](https://discuss.elastic.co/t/apm-ui-not-able-to-search-for-child-span-transaction-labels/294081/6 "2022-02-24T10:58:58Z")

</div>

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