Skip to content

Commit 674a4b2

Browse files
authored
[feat][backend] GetTracesAdvanceInfo support ThirdParty (#446)
GetTracesAdvanceInfo support ThirdParty
1 parent 4a97cf2 commit 674a4b2

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

backend/modules/observability/domain/trace/service/trace_service.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,11 +1302,15 @@ func (r *TraceServiceImpl) GetTracesAdvanceInfo(ctx context.Context, req *GetTra
13021302
resp := &GetTracesAdvanceInfoResp{
13031303
Infos: []*loop_span.TraceAdvanceInfo{},
13041304
}
1305+
workspaceID := strconv.FormatInt(req.WorkspaceID, 10)
1306+
if req.ThirdPartyWorkspaceID != "" {
1307+
workspaceID = req.ThirdPartyWorkspaceID
1308+
}
13051309
for _, v := range req.Traces {
13061310
g.Go(func() error {
13071311
defer goroutine.Recovery(ctx)
13081312
qReq := &repo.GetTraceParam{
1309-
WorkSpaceID: strconv.FormatInt(req.WorkspaceID, 10),
1313+
WorkSpaceID: workspaceID,
13101314
Tenants: tenants,
13111315
TraceID: v.TraceID,
13121316
StartAt: v.StartTime,
@@ -1327,13 +1331,14 @@ func (r *TraceServiceImpl) GetTracesAdvanceInfo(ctx context.Context, req *GetTra
13271331
return err
13281332
}
13291333
processors, err := r.buildHelper.BuildAdvanceInfoProcessors(ctx, span_processor.Settings{
1330-
WorkspaceId: req.WorkspaceID,
1331-
PlatformType: req.PlatformType,
1332-
QueryStartTime: v.StartTime,
1333-
QueryEndTime: v.EndTime + defaultTimeRange,
1334-
SpanDoubleCheck: true,
1335-
QueryTenants: tenants,
1336-
QueryTraceID: v.TraceID,
1334+
WorkspaceId: req.WorkspaceID,
1335+
ThirdPartyWorkspaceID: req.ThirdPartyWorkspaceID,
1336+
PlatformType: req.PlatformType,
1337+
QueryStartTime: v.StartTime,
1338+
QueryEndTime: v.EndTime + defaultTimeRange,
1339+
SpanDoubleCheck: true,
1340+
QueryTenants: tenants,
1341+
QueryTraceID: v.TraceID,
13371342
})
13381343
if err != nil {
13391344
logs.CtxError(ctx, "Fail to build advance info processor, %v", err)

0 commit comments

Comments
 (0)