K8sLogStreamer
This class streams logs directly from Kubernetes pods.
Methods
TailLogs()
@classmethod
def TailLogs(
ctx: context.Context,
logContext: *core.LogContext,
stream: *connect.ServerStream[dataproxy.TailLogsResponse]
) - > error
Streams logs directly from Kubernetes pods. This method allows a caller to receive a continuous stream of log entries from a specified Kubernetes pod, which is useful for real-time monitoring and debugging.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, used to manage cancellation and deadlines for the log streaming operation. |
| logContext | *core.LogContext | The context specifying which Kubernetes pod's logs to stream, including details like pod name, namespace, and container. |
| stream | *connect.ServerStream[dataproxy.TailLogsResponse] | The server stream through which log entries will be sent back to the client as dataproxy.TailLogsResponse messages. |
Returns
| Type | Description |
|---|---|
error | Returns an error if the log streaming operation fails. |