Root spans should have the parent span ID left empty but Trace Exporter is setting them to 0000000000000000 which is not a valid span ID and shows up in Cloud Trace as (Missing span ID 0000000000000000).
if (spanData.getParentSpanId() != null) {
spanBuilder.setParentSpanId(spanData.getParentSpanId());
}
Instead of checking to see if the parent span ID is not null the check should be for if the parent context is valid:
if (spanData.getParentSpanContext().isValid()) {
spanBuilder.setParentSpanId(spanData.getParentSpanId());
}
After making that change to a local copy of the TraceTranslator.java I no longer see the (Missing span ID 0000000000000000) spans and the root span has the parent span ID empty.
Root spans should have the parent span ID left empty but Trace Exporter is setting them to
0000000000000000
which is not a valid span ID and shows up in Cloud Trace as(Missing span ID 0000000000000000)
.I believe the issue is in exporters/trace/src/main/java/com/google/cloud/opentelemetry/trace/TraceTranslator.java
Instead of checking to see if the parent span ID is not null the check should be for if the parent context is valid:
After making that change to a local copy of the TraceTranslator.java I no longer see the
(Missing span ID 0000000000000000)
spans and the root span has the parent span ID empty.