Skip to content

Commit 0115000

Browse files
phantom-rabbitruibo.qin
andauthored
fix add instal log completa (#579)
Co-authored-by: ruibo.qin <[email protected]>
1 parent 8300770 commit 0115000

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

api/handler/repo.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,6 +1852,7 @@ func (h *RepoHandler) DeployInstanceLogs(ctx *gin.Context) {
18521852
DeployID: deployID,
18531853
DeployType: types.InferenceType,
18541854
InstanceName: instance,
1855+
Since: ctx.Query("since"),
18551856
}
18561857

18571858
// user http request context instead of gin context, so that server knows the life cycle of the request
@@ -2378,6 +2379,7 @@ func (h *RepoHandler) ServerlessLogs(ctx *gin.Context) {
23782379
DeployID: deployID,
23792380
DeployType: types.ServerlessType,
23802381
InstanceName: instance,
2382+
Since: ctx.Query("since"),
23812383
}
23822384

23832385
// user http request context instead of gin context, so that server knows the life cycle of the request

builder/deploy/deployer.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,13 @@ func (d *deployer) InstanceLogs(ctx context.Context, dr types.DeployRepo) (*Mult
553553
}
554554

555555
deployId := fmt.Sprintf("%d", deploy.ID)
556-
556+
var startTime = deploy.CreatedAt
557+
if dr.Since != "" {
558+
startTime = parseSinceTime(dr.Since)
559+
}
557560
runLog, err := d.readLogsFromLoki(ctx, types.ReadLogRequest{
558561
DeployID: deployId,
559-
StartTime: deploy.CreatedAt,
562+
StartTime: startTime,
560563
Labels: labels,
561564
})
562565
if err != nil {

common/types/model.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ type DeployActReq struct {
351351
DeployID int64 `json:"deploy_id"`
352352
DeployType int `json:"deploy_type"`
353353
InstanceName string `json:"instance_name"`
354+
Since string `json:"since,omitempty"`
354355
}
355356

356357
type DeployUpdateReq struct {

component/repo.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2706,6 +2706,7 @@ func (c *repoComponentImpl) DeployInstanceLogs(ctx context.Context, logReq types
27062706
ClusterID: deploy.ClusterID,
27072707
SvcName: deploy.SvcName,
27082708
InstanceName: logReq.InstanceName,
2709+
Since: logReq.Since,
27092710
})
27102711
}
27112712

0 commit comments

Comments
 (0)