Skip to content

Commit d1f8b66

Browse files
Update TraceTranslator.java (#296)
Check to see if parent context is valid instead of parent span ID not null Co-authored-by: Pranav Sharma <sharmapranav@google.com>
1 parent 7e4e957 commit d1f8b66

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

exporters/trace/src/main/java/com/google/cloud/opentelemetry/trace/TraceTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Span generateSpan(SpanData spanData, String projectId) {
120120
spanBuilder.setEndTime(toTimestampProto(end));
121121
}
122122
spanBuilder.setLinks(toLinksProto(spanData.getLinks(), spanData.getTotalRecordedLinks()));
123-
if (spanData.getParentSpanId() != null) {
123+
if (spanData.getParentSpanContext().isValid()) {
124124
spanBuilder.setParentSpanId(spanData.getParentSpanId());
125125
}
126126
boolean hasRemoteParent = spanData.getParentSpanContext().isRemote();

0 commit comments

Comments
 (0)