Documentation
¶
Overview ¶
Package logread is the thin pure-Go function-log reader (ADR-0084): it merges the compacted Parquet (ADR-0083) with the recent raw OTLP-JSONL tail (ADR-0081) over the blob.Bucket port, filters by time/severity/limit, and returns a tenant's function logs time-ordered. No DuckDB, no cgo, lakehouse-independent. Tenant scoping is the caller's concern (the control-plane PEP authorizes the namespace before calling Read); this package just reads the namespace it is given.
Index ¶
Constants ¶
const ( // DefaultLimit caps a read when Query.Limit is unset. DefaultLimit = 1000 // MaxLimit hard-caps a read (≈ a few MB of lines — bounds a runaway scan). MaxLimit = 10000 )
Variables ¶
This section is empty.
Functions ¶
func SeverityNumber ¶
SeverityNumber maps a level name (trace|debug|info|warn|error|fatal, case-insensitive) to its OTLP SeverityNumber threshold (the lowest number at that level); ok=false for an unknown name. "" ⇒ (0, true) = no filter.
Types ¶
type BlobReader ¶
type BlobReader struct {
// contains filtered or unexported fields
}
BlobReader is the blob-backed Reader (compacted Parquet + raw OTLP-JSONL tail over blob.Bucket).
func NewBlobReader ¶
func NewBlobReader(b blob.Bucket) *BlobReader
NewBlobReader builds the reader over the funcd-system observability bucket.
type Line ¶
type Line struct {
Time v1.Timestamp `json:"time"`
Severity string `json:"severity"`
SeverityNumber int32 `json:"severityNumber"`
Body string `json:"body"`
Namespace string `json:"namespace"`
Function string `json:"function"`
Replica string `json:"replica"`
Source string `json:"source"`
Invocation string `json:"inv,omitempty"`
TraceID string `json:"traceId,omitempty"`
SpanID string `json:"spanId,omitempty"`
Attrs json.RawMessage `json:"attrs,omitempty"`
}
Line is one log record returned to a caller (the wire + CLI DTO; a friendlier view of compact.Row).
type Query ¶
type Query struct {
Namespace string
Function string
Since time.Time // zero ⇒ no lower bound
MinSeverityNumber int32 // 0 ⇒ all severities
Limit int // <= 0 ⇒ DefaultLimit; capped at MaxLimit
// TraceID scopes the read to one run's trace (ADR-0106): "" ⇒ no trace filter (ADR-0084 per-function
// behavior). When Function == "" && TraceID != "", Read scans the whole logs/<ns>/ prefix (namespace-wide,
// run-scoped) — every step function's lines for that run, incl. sub-workflow children (same trace, ADR-0104).
TraceID string
}
Query selects + bounds a read. Namespace is required; Function OR TraceID must be set (a bare namespace scan with no trace filter is rejected — see Read's guard). The rest are optional filters.