# The selected trace cannot be found when viewing traces in apm

**URL:** <https://discuss.elastic.co/t/the-selected-trace-cannot-be-found-when-viewing-traces-in-apm/303852>\
**Category:** APM\
**Tags:** ui\
**Created:** [May 3, 2022, 3:38pm UTC](https://discuss.elastic.co/t/the-selected-trace-cannot-be-found-when-viewing-traces-in-apm/303852 "2022-05-03T15:38:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eirik\_Bell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eirik_bell/32/95573_2.png) [@Eirik\_Bell](https://discuss.elastic.co/u/Eirik_Bell)\
**Post date:** [May 3, 2022, 3:38pm UTC](https://discuss.elastic.co/t/the-selected-trace-cannot-be-found-when-viewing-traces-in-apm/303852/1 "2022-05-03T15:38:02Z")

</div>

Elastic: 7.15.2 (ECE)  
Kibana: 7.15.2 (ECE)  
APM Server: 7.17.3 (ECK)  
ECS: 1.12.0

We have a setup with multiple spaces and multiple teams ingesting apm data using apm server. The data for my team is located in indices on a data stream with the pattern traces-apm._-_ while other teams not started with data streams have their indices in apm-\*

In the trace samples on a transaction we receive an error message:

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

While debugging I found the following api call:  
[https://ops.ece.tv2.no/s/rp/api/apm/traces/1600835dedde53f2c0134aa55d4de2bc?start=2022-05-02T12:00:00.000Z&end=2022-05-03T12:29:35.119Z](https://ops.ece.tv2.no/s/rp/api/apm/traces/1600835dedde53f2c0134aa55d4de2bc?start=2022-05-02T12:00:00.000Z&end=2022-05-03T12:29:35.119Z)  
Which responds with:

```auto
{
"trace": {
"items": [],
"exceedsMax": false,
"errorDocs": []
},
"errorsPerTransaction": {}
}

```

I thus went to discover and searched up the entries I was expecting to see:

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

My next thought was that there is a problem with the settings in APM module in Kibana, but this looks correct to me:

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

This should? map to my data streams:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/d/4dc8efd8c52e07f2cf33f022f3d54ae564fd779d.png)

Anyone know why the api responds with empty trace? Transactions which are in apm-\* indices (without data stream) responds with items in the trace.items object like this (removed most content for brevity):

```auto
{
"trace": {
"items": [
{
"container": {
"id": "4ea0c34e6de0358cc36f9b4a790f347a1c7cee4cb48991092c52e18f17133b5b"
},
"kubernetes": {},
"agent": {},
"source": {},
"cloud": {},
"observer": {},
"trace": {},
"ecs": {},
"host": {},
"client": {},
"event": {},
"user_agent": {},
"timestamp": {},
"process": {},
"processor": {},
"url": {},
"@timestamp": "2022-05-03T11:21:14.575Z",
"service": {},
"http": {},
"transaction": {
"result": "HTTP 2xx",
"duration": {},
"name": "GET /v4/feed/{feedId}",
"span_count": {},
"id": "026f94125aa4ac75",
"type": "request",
"sampled": true
}
},
{},
{}
],
"exceedsMax": false,
"errorDocs": []
},
"errorsPerTransaction": {}
}

```

---

<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:** [May 24, 2022, 11:38am UTC](https://discuss.elastic.co/t/the-selected-trace-cannot-be-found-when-viewing-traces-in-apm/303852/2 "2022-05-24T11:38:56Z")

</div>

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