Skip to content

Commit 1fda402

Browse files
authored
Use consistent log field for call and container ID (#1466)
Container ID is logged inconsistently as `container_id` and `id` in "call started" and "hot function terminating" messages. `id` is also used elsewhere for Call ID. Change them all to `container_id` and `call_id` for consistency.
1 parent 3d59d9c commit 1fda402

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/agent/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ func (a *agent) runHot(ctx context.Context, caller slotCaller, call *call, tok R
758758
var err error
759759

760760
id := id.New().String()
761-
logger := logrus.WithFields(logrus.Fields{"id": id, "app_id": call.AppID, "fn_id": call.FnID, "image": call.Image, "memory": call.Memory, "cpus": call.CPUs, "idle_timeout": call.IdleTimeout})
761+
logger := logrus.WithFields(logrus.Fields{"container_id": id, "app_id": call.AppID, "fn_id": call.FnID, "image": call.Image, "memory": call.Memory, "cpus": call.CPUs, "idle_timeout": call.IdleTimeout})
762762
ctx, cancel := context.WithCancel(common.WithLogger(ctx, logger))
763763

764764
initialized := make(chan struct{}) // when closed, container is ready to handle requests

api/agent/call.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func (a *agent) GetCall(opts ...CallOpt) (Call, error) {
274274

275275
func setupCtx(c *call) {
276276
ctx, _ := common.LoggerWithFields(c.req.Context(),
277-
logrus.Fields{"id": c.ID, "app_id": c.AppID, "fn_id": c.FnID})
277+
logrus.Fields{"call_id": c.ID, "app_id": c.AppID, "fn_id": c.FnID})
278278
c.req = c.req.WithContext(ctx)
279279
}
280280

0 commit comments

Comments
 (0)