Skip to content

Commit ebf6205

Browse files
committed
feat: add app_id to ApplyDeployment proto and krane pod labels
- Proto: add app_id field (18) to ApplyDeployment message - Ctrl: pass deployment.AppID through deploymentRowToState - Krane: add .AppID() label to deployment pods so Vector extracts it
1 parent 5b61832 commit ebf6205

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

gen/proto/ctrl/v1/cluster.pb.go

Lines changed: 14 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

svc/ctrl/proto/ctrl/v1/cluster.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,10 @@ message ApplyDeployment {
308308
// healthcheck is a JSON-encoded Healthcheck struct for configuring liveness/readiness probes.
309309
// If empty, no probes are configured.
310310
optional bytes healthcheck = 17;
311+
312+
// app_id identifies the app within the project.
313+
// Used for pod labels so Vector can extract it into runtime logs.
314+
string app_id = 18;
311315
}
312316

313317
// DeleteDeployment identifies a deployment to remove from the cluster.

svc/ctrl/services/cluster/rpc_watch_deployments.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ func (s *Service) deploymentRowToState(row db.ListDeploymentTopologyByRegionRow)
126126
WorkspaceId: row.Deployment.WorkspaceID,
127127
ProjectId: row.Deployment.ProjectID,
128128
EnvironmentId: row.Deployment.EnvironmentID,
129+
AppId: row.Deployment.AppID,
129130
Replicas: row.DeploymentTopology.DesiredReplicas,
130131
Image: row.Deployment.Image.String,
131132
CpuMillicores: int64(row.Deployment.CpuMillicores),

svc/krane/internal/deployment/apply.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func (c *Controller) ApplyDeployment(ctx context.Context, req *ctrlv1.ApplyDeplo
6666
usedLabels := labels.New().
6767
WorkspaceID(req.GetWorkspaceId()).
6868
ProjectID(req.GetProjectId()).
69+
AppID(req.GetAppId()).
6970
EnvironmentID(req.GetEnvironmentId()).
7071
DeploymentID(req.GetDeploymentId()).
7172
BuildID(req.GetBuildId()).

0 commit comments

Comments
 (0)