Documentation
¶
Overview ¶
Package actorlog provides structured JSON logging for actor sandboxes shared by the gVisor and micro-VM ateom runtimes. It forwards an actor container's stdout/stderr to the worker pod's stdout, annotated with the ate.* identity labels from internal/ateattr, and emits synthetic actor lifecycle events.
Only the lifecycle events carry trace context: one forwarder goroutine covers a whole container stream, so it cannot tell which request produced a given line. An actor emitting its own trace_id/span_id keeps them, verbatim like the rest of its fields.
Index ¶
- type ActorLogger
- func (al *ActorLogger) EmitLifecycleLog(ctx context.Context, msg string, a resources.ActorAttribution)
- func (al *ActorLogger) StartJSONLogPipe(a resources.ActorAttribution, containerName string) (io.WriteCloser, error)
- func (al *ActorLogger) WrapContainerLogs(r io.Reader, a resources.ActorAttribution, containerName string)
- type SyncedWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActorLogger ¶
type ActorLogger struct {
// contains filtered or unexported fields
}
ActorLogger handles structured logging for actor sandboxes and lifecycle events.
func NewActorLogger ¶
func NewActorLogger(w io.Writer, isOnGCE bool) *ActorLogger
NewActorLogger creates a new ActorLogger wrapping the provided destination writer.
func (*ActorLogger) EmitLifecycleLog ¶
func (al *ActorLogger) EmitLifecycleLog(ctx context.Context, msg string, a resources.ActorAttribution)
EmitLifecycleLog logs a synthetic actor lifecycle event. The record joins the trace of the RPC that drove the transition whenever ctx carries one.
func (*ActorLogger) StartJSONLogPipe ¶
func (al *ActorLogger) StartJSONLogPipe(a resources.ActorAttribution, containerName string) (io.WriteCloser, error)
StartJSONLogPipe intercepts container raw stdout/stderr streams and pipes them through the logger. containerName tags every line with the originating container; callers that multiplex multiple containers should give each its own pipe so the tag is meaningful.
func (*ActorLogger) WrapContainerLogs ¶
func (al *ActorLogger) WrapContainerLogs(r io.Reader, a resources.ActorAttribution, containerName string)
WrapContainerLogs reads log lines from r, parses them, and logs them in a unified structured format. containerName is added as the ate.actor.container.name label so multi-container actors can be demultiplexed.
type SyncedWriter ¶
type SyncedWriter struct {
// contains filtered or unexported fields
}
SyncedWriter wraps an io.Writer and synchronizes writes across goroutines.
func NewSyncedWriter ¶
func NewSyncedWriter(w io.Writer) *SyncedWriter
NewSyncedWriter returns a new SyncedWriter wrapping the given io.Writer.