Documentation
¶
Overview ¶
Package logclient reads container logs from the platform's central log service.
A sandbox's Pod holds its logs only while it exists. Once the sandbox is released the Pod is recycled and the Kubernetes log API has nothing left to return — but the lines were shipped to the central service, which is where anyone asking "what did that run print" has to be sent. The dashboard has queried it since the log integration landed; this is the same query from the worker, so the API can answer for a sandbox that has already ended.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client queries the central log service.
func New ¶
New returns a Client. An empty URL or Token leaves it unconfigured; callers must check Ready.
func (*Client) Query ¶
func (c *Client) Query( ctx context.Context, podName string, filters map[string]string, start, end time.Time, limit int, ) ([]Entry, error)
Query returns the lines the named Pod produced within [start, end].
filters scope the query to one cluster (region / cluster labels). They are not optional in practice: pod names are unique per cluster, not globally, so an unscoped query can return another cluster's output for the same name.
type Config ¶
type Config struct {
// URL is the download endpoint, e.g.
// https://op.example.com/api/v1/rms/logging/download
URL string
// AppID selects the authentication scheme: set it for the signed scheme
// (Signature/AppID/Timestamp/Randstr), leave it empty for Bearer.
AppID string
// Token is the signing token, or the bearer token when AppID is empty.
Token string
// Project scopes the query on gateways that require it; empty omits it.
Project string
// Timeout bounds one query.
Timeout time.Duration
}
Config addresses the central log service.