Skip to content

Commit

Permalink
Update TraceTranslator.java (#296)
Browse files Browse the repository at this point in the history
Check to see if parent context is valid instead of parent span ID not null

Co-authored-by: Pranav Sharma <sharmapranav@google.com>
  • Loading branch information
WadeGulbrandsen and psx95 authored Feb 12, 2024
1 parent 7e4e957 commit d1f8b66
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Span generateSpan(SpanData spanData, String projectId) {
spanBuilder.setEndTime(toTimestampProto(end));
}
spanBuilder.setLinks(toLinksProto(spanData.getLinks(), spanData.getTotalRecordedLinks()));
if (spanData.getParentSpanId() != null) {
if (spanData.getParentSpanContext().isValid()) {
spanBuilder.setParentSpanId(spanData.getParentSpanId());
}
boolean hasRemoteParent = spanData.getParentSpanContext().isRemote();
Expand Down

0 comments on commit d1f8b66

Please sign in to comment.