Skip to content

Commit

Permalink
Replace trace ID with latency in trace list
Browse files Browse the repository at this point in the history
  • Loading branch information
ymtdzzz committed Sep 8, 2024
1 parent 99d623a commit 8bbb11d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tuiexporter/internal/tui/component/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

var spanTableHeader = [5]string{
" ", // Error indicator
"Trace ID",
"Service Name",
"Latency",
"Received At",
"Span Name",
}
Expand Down Expand Up @@ -69,11 +69,12 @@ func (s SpanDataForTable) getCellFromSpan(span *telemetry.SpanData, column int)
}
}
case 1:
text = span.Span.TraceID().String()
case 2:
if sname, ok := span.ResourceSpan.Resource().Attributes().Get("service.name"); ok {
text = sname.AsString()
}
case 2:
duration := span.Span.EndTimestamp().AsTime().Sub(span.Span.StartTimestamp().AsTime())
text = duration.String()
case 3:
text = span.ReceivedAt.Local().Format("2006-01-02 15:04:05")
case 4:
Expand Down

0 comments on commit 8bbb11d

Please sign in to comment.