Documentation
¶
Index ¶
- Constants
- func CGroupPathForPid(pid uint32) (string, error)
- func TestInject(reg *asm.Registry)
- type BoundPort
- type DebugLogWriter
- type EntityStatus
- type LogEntry
- type LogReader
- func (l *LogReader) Populated() error
- func (l *LogReader) Read(ctx context.Context, id string, opts ...LogReaderOption) ([]LogEntry, error)
- func (l *LogReader) ReadBySandbox(ctx context.Context, sandboxID string, opts ...LogReaderOption) ([]LogEntry, error)
- func (l *LogReader) ReadStream(ctx context.Context, target LogTarget, logCh chan<- LogEntry, ...) error
- func (l *LogReader) TailStream(ctx context.Context, target LogTarget, logCh chan<- LogEntry, ...) error
- type LogReaderOption
- type LogStream
- type LogTarget
- type LogWriter
- type LogsMaintainer
- type PersistentLogReader
- type PersistentLogWriter
- type PortStatus
- type PortTracker
- type ResourcesMonitor
- type StatusMonitor
Constants ¶
View Source
const DefaultLogReadLimit = 1000
Variables ¶
This section is empty.
Functions ¶
func CGroupPathForPid ¶
func TestInject ¶
Types ¶
type DebugLogWriter ¶
func (*DebugLogWriter) WriteEntry ¶
func (d *DebugLogWriter) WriteEntry(entity string, le LogEntry) error
type EntityStatus ¶
type EntityStatus struct {
// contains filtered or unexported fields
}
func (*EntityStatus) Id ¶
func (e *EntityStatus) Id() string
type LogReader ¶
type LogReader struct {
Address string `asm:"victorialogs-address"`
Timeout time.Duration `asm:"victorialogs-timeout"`
// contains filtered or unexported fields
}
func (*LogReader) ReadBySandbox ¶
func (*LogReader) ReadStream ¶
func (l *LogReader) ReadStream(ctx context.Context, target LogTarget, logCh chan<- LogEntry, opts ...LogReaderOption) error
ReadStream queries historical logs and sends them to a channel as they're parsed. Unlike Read(), this has no limit and streams results incrementally.
func (*LogReader) TailStream ¶
func (l *LogReader) TailStream(ctx context.Context, target LogTarget, logCh chan<- LogEntry, opts ...LogReaderOption) error
TailStream connects to VictoriaLogs tail endpoint for live tailing. Blocks until context is cancelled.
type LogReaderOption ¶
type LogReaderOption func(*logReadOpts)
func WithFromTime ¶
func WithFromTime(t time.Time) LogReaderOption
func WithLimit ¶
func WithLimit(l int) LogReaderOption
type LogTarget ¶
type LogTarget struct {
EntityID string
SandboxID string
Filter string // Optional LogsQL filter expression (e.g., "error" or ~"regex")
}
LogTarget specifies what logs to query - either by entity ID or sandbox ID.
type LogsMaintainer ¶
type LogsMaintainer struct {
}
type PersistentLogReader ¶
type PersistentLogReader struct {
Address string `asm:"victorialogs-address"`
Timeout time.Duration `asm:"victorialogs-timeout"`
// contains filtered or unexported fields
}
func (*PersistentLogReader) Populated ¶
func (l *PersistentLogReader) Populated() error
type PersistentLogWriter ¶
type PersistentLogWriter struct {
Address string `asm:"victorialogs-address"`
Timeout time.Duration `asm:"victorialogs-timeout"`
// contains filtered or unexported fields
}
func (*PersistentLogWriter) Client ¶
func (l *PersistentLogWriter) Client() *http.Client
func (*PersistentLogWriter) Populated ¶
func (l *PersistentLogWriter) Populated() error
func (*PersistentLogWriter) WriteEntry ¶
func (l *PersistentLogWriter) WriteEntry(entity string, le LogEntry) error
type PortStatus ¶
type PortStatus string
const ( PortStatusBound PortStatus = "bound" PortStatusUnbound PortStatus = "unbound" PortStatusActive PortStatus = "active" )
type PortTracker ¶
type PortTracker interface {
SetPortStatus(containerID string, bp BoundPort, status PortStatus)
}
type ResourcesMonitor ¶
type ResourcesMonitor struct {
Writer *metrics.VictoriaMetricsWriter `asm:"victoriametrics-writer"`
Reader *metrics.VictoriaMetricsReader `asm:"victoriametrics-reader"`
Log *slog.Logger
}
func (*ResourcesMonitor) LastestUsage ¶
func (m *ResourcesMonitor) LastestUsage(id string) (float64, uint64, error)
type StatusMonitor ¶
func (*StatusMonitor) EntityBoundPorts ¶
func (s *StatusMonitor) EntityBoundPorts(entity string) ([]BoundPort, error)
func (*StatusMonitor) FindBoundPort ¶
func (s *StatusMonitor) FindBoundPort(bp BoundPort) ([]*EntityStatus, error)
func (*StatusMonitor) Populated ¶
func (s *StatusMonitor) Populated() error
func (*StatusMonitor) SetPortStatus ¶
func (s *StatusMonitor) SetPortStatus(entity string, port BoundPort, status PortStatus)
Click to show internal directories.
Click to hide internal directories.