Skip to content

Commit

Permalink
add depl target id to log label match (#3720)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feroze Mohideen authored Oct 3, 2023
1 parent 2c1e199 commit 4d5b847
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/server/handlers/porter_app/logs_apply_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const (
lokiLabel_PorterAppName = "porter_run_app_name"
lokiLabel_PorterServiceName = "porter_run_service_name"
lokiLabel_PorterAppRevisionID = "porter_run_app_revision_id"
lokiLabel_DeploymentTargetId = "porter_run_deployment_target_id"
lokiLabel_Namespace = "namespace"
)

Expand Down Expand Up @@ -158,6 +159,8 @@ func (c *AppLogsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
matchLabels[lokiLabel_PorterAppRevisionID] = request.AppRevisionID
}

matchLabels[lokiLabel_DeploymentTargetId] = request.DeploymentTargetID

logRequest := &types.LogRequest{
Limit: request.Limit,
StartRange: &request.StartRange,
Expand Down
1 change: 1 addition & 0 deletions api/server/handlers/porter_app/stream_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func (c *StreamLogsLokiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request
labels := []string{
fmt.Sprintf("%s=%s", lokiLabel_Namespace, namespace),
fmt.Sprintf("%s=%s", lokiLabel_PorterAppName, request.AppName),
fmt.Sprintf("%s=%s", lokiLabel_DeploymentTargetId, request.DeploymentTargetID),
}

if request.ServiceName != "all" {
Expand Down

0 comments on commit 4d5b847

Please sign in to comment.