-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: new trace details waterfall integration #6708
base: main
Are you sure you want to change the base?
Conversation
contributes to - #6132 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have added few comments, the main point will be to add tests for the logics you have implemented.
Apart from that the flux interval should be there and it should be configurable with default set to 1 min.
@@ -156,6 +158,8 @@ type ClickHouseReader struct { | |||
traceLocalTableName string | |||
traceResourceTableV3 string | |||
traceSummaryTable string | |||
|
|||
CacheV2 cacheV2.Cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be private instead of public ? cacheV2
@@ -1441,6 +1449,293 @@ func (r *ClickHouseReader) SearchTraces(ctx context.Context, params *model.Searc | |||
return &searchSpansResult, nil | |||
} | |||
|
|||
func contains(slice []string, item string) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should go to utils ?
|
||
// create the trace tree based on the spans fetched above | ||
// create a map of [spanId]: spanNode | ||
for _, item := range searchScanResponses { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this logic can be moved to utils/traces. And proper test cases
|
||
// traverse through the map and append each node to the children array of the parent node | ||
// capture the root nodes as well | ||
for _, spanNode := range spanIdToSpanNodeMap { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for this
|
||
// mark the current path from root to the interested node as uncollapsed | ||
// Important - do not mark the interested node as uncollapsed in the above exercise to handle node collapses | ||
rootToInterestedNodePath = func(node *model.Span) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part as well, should be invdividually testable
// get the index for the interested span id | ||
if req.InterestedSpanID != "" { | ||
for i, span := range preOrderTraversal { | ||
if span.SpanID == req.InterestedSpanID { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this logic be merged with traverse function, this will prevent reiteration ?
@@ -538,6 +538,7 @@ func (aH *APIHandler) RegisterRoutes(router *mux.Router, am *AuthMiddleware) { | |||
|
|||
router.HandleFunc("/api/v2/traces/fields", am.ViewAccess(aH.traceFields)).Methods(http.MethodGet) | |||
router.HandleFunc("/api/v2/traces/fields", am.EditAccess(aH.updateTraceField)).Methods(http.MethodPost) | |||
router.HandleFunc("/api/v2/traces/{traceId}", am.ViewAccess(aH.SearchTracesV3)).Methods(http.MethodPost) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename searchTracesV3
to listSpans
or getSpansForTrace
?
Level int64 `json:"level"` | ||
} | ||
|
||
type SearchTracesV3Cache struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be in response.go as it is not a response struct.
@@ -315,6 +315,12 @@ type SearchTracesParams struct { | |||
MaxSpansInTrace int `json:"maxSpansInTrace"` | |||
} | |||
|
|||
type SearchTracesV3Params struct { | |||
InterestedSpanID string `json:"interestedSpanId"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: instead of insterested, will selectedSpanID
be more verbose ?
Summary
v2/traces/{traceID}
for the new trace details APIinterestedSpanId
received from frontendRelated Issues / PR's
contributes to - #6132
Screenshots
NA
Affected Areas and Manually Tested Areas