# Missing child spans on OpenTelemetry traces

**URL:** <https://discuss.elastic.co/t/missing-child-spans-on-opentelemetry-traces/340390>\
**Category:** APM\
**Tags:** ui, open-telemetry\
**Created:** [August 8, 2023, 5:23pm UTC](https://discuss.elastic.co/t/missing-child-spans-on-opentelemetry-traces/340390 "2023-08-08T17:23:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastien\_Dan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebastien_dan/32/124445_2.png) [@Sebastien\_Dan](https://discuss.elastic.co/u/Sebastien_Dan)\
**Post date:** [August 8, 2023, 5:23pm UTC](https://discuss.elastic.co/t/missing-child-spans-on-opentelemetry-traces/340390/1 "2023-08-08T17:23:22Z")

</div>

**Kibana version** : 8.9.0

**Elasticsearch version** : 8.9.0

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: Elastic Cloud, no APM agent

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

Child spans are not displayed on Kibana.

My setup is the following: my instrumented web app sends OpenTelemetry traces to my otel collector which exports them to Elastic Cloud.

Printing extra logs from the otel collector, I rightfully get the following:

```auto
2023-08-08T17:09:54.620Z	info	TracesExporter	{"kind": "exporter", "data_type": "traces", "name": "logging", "#spans": 2}
2023-08-08T17:09:54.620Z	info	ResourceSpans #0
Resource SchemaURL:
Resource attributes:
     -> service.name: Str(dapp-frontend-erc20-messaging)
     -> telemetry.sdk.language: Str(webjs)
     -> telemetry.sdk.name: Str(opentelemetry)
     -> telemetry.sdk.version: Str(1.15.1)
     -> service.version: Str(0.1.0)
ScopeSpans #0
ScopeSpans SchemaURL:
InstrumentationScope dapp-frontend-erc20-messaging 0.1.0
Span #0
    Trace ID : 5633a95f60cc533d9432636b995ba427
    Parent ID : f406221c88072f31
    ID : 550fce0f887494d2
    Name : step-0
    Kind : Internal
    Start time : 2023-08-08 17:09:48.566000128 +0000 UTC
    End time : 2023-08-08 17:09:51.333199872 +0000 UTC
    Status code : Unset
    Status message :
Span #1
    Trace ID : 5633a95f60cc533d9432636b995ba427
    Parent ID :
    ID : f406221c88072f31
    Name : multi-step-form
    Kind : Internal
    Start time : 2023-08-08 17:09:48.564999936 +0000 UTC
    End time : 2023-08-08 17:09:51.333299968 +0000 UTC
    Status code : Unset
    Status message :
	{"kind": "exporter", "data_type": "traces", "name": "logging"}

```

I.e., a simple `multi-step-form` root span that contains one single `step-0` child span. From these logs above I understand my instrumentation is working as expected.

The problem is that on Kibana/APM, **except a few rare and seemingly random times** , I only see the root span:

 ![Screenshot 2023-08-08 at 19.20.24](https://us1.discourse-cdn.com/elastic/original/3X/8/6/86a889cb7e17595f43d3233a0dcf93c1fd314c24.png)

Even more surprisingly, if my child span emits events, I do see them as "Logs" of the root span.

If anyone has any idea what's going on, I'm all ears!

---

<div class="post-metadata">

**Author:** ![alexander.wert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander.wert/32/95085_2.png) [@alexander.wert](https://discuss.elastic.co/u/alexander.wert)\
**Post date:** [August 10, 2023, 11:53am UTC](https://discuss.elastic.co/t/missing-child-spans-on-opentelemetry-traces/340390/2 "2023-08-10T11:53:38Z")

</div>

Hi @Sebastien_Dan ,

thanks for reporting this!

When searching in Kibana's Discover for the corresponding trace id within the `APM` data view (with the following query in the query bar), do you see both spans in the results or only the parent span?

```auto
trace.id: "5633a95f60cc533d9432636b995ba427"

```

---

<div class="post-metadata">

**Author:** ![Sebastien\_Dan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebastien_dan/32/124445_2.png) [@Sebastien\_Dan](https://discuss.elastic.co/u/Sebastien_Dan)\
**Post date:** [August 10, 2023, 11:56am UTC](https://discuss.elastic.co/t/missing-child-spans-on-opentelemetry-traces/340390/3 "2023-08-10T11:56:35Z")

</div>

Hey @alexander.wert, thanks for replying! (which just happened coincidentally when I looked at the page!)

When searching on Discover, I do not find the missing spans (note: in the very rare occasion when the APM view did show one of the child spans (but one only), it was also findable on Discover).

---

<div class="post-metadata">

**Author:** ![Sebastien\_Dan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebastien_dan/32/124445_2.png) [@Sebastien\_Dan](https://discuss.elastic.co/u/Sebastien_Dan)\
**Post date:** [August 15, 2023, 3:32pm UTC](https://discuss.elastic.co/t/missing-child-spans-on-opentelemetry-traces/340390/4 "2023-08-15T15:32:03Z")

</div>

Hey @alexander.wert, would you have any lead on this?

---

<div class="post-metadata">

**Author:** ![Sebastien\_Dan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebastien_dan/32/124445_2.png) [@Sebastien\_Dan](https://discuss.elastic.co/u/Sebastien_Dan)\
**Post date:** [August 24, 2023, 7:17am UTC](https://discuss.elastic.co/t/missing-child-spans-on-opentelemetry-traces/340390/5 "2023-08-24T07:17:58Z")

</div>

@alexander.wert FYI, I tested another approach with local elastic APM agents sending data directly to Elastic (from both the browser and my nodejs server) instead of otel lib -\> otel collector -\> Elastic, and I do not get the issue. So perhaps there's a otel collector -\> Elastic parsing issue here?

---

<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 21, 2023, 7:18am UTC](https://discuss.elastic.co/t/missing-child-spans-on-opentelemetry-traces/340390/6 "2023-09-21T07:18:44Z")

</div>

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