Documentation
¶
Index ¶
- Constants
- Variables
- func CGroupPathForPid(pid uint32) (string, error)
- func TestInject(reg *asm.Registry)
- type BoundPort
- type DebugLogWriter
- type EntityStatus
- type Inet6Addr
- type InetAddr
- 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 RunSCMonitor
- func (r *RunSCMonitor) Close() error
- func (r *RunSCMonitor) Messages() uint64
- func (r *RunSCMonitor) Monitor(ctx context.Context) error
- func (r *RunSCMonitor) NewClient() (monitor.MessageHandler, error)
- func (r *RunSCMonitor) SetEndpoint(endpoint string)
- func (r *RunSCMonitor) WritePodInit(path string) error
- type SockAddr
- type SockAddrInet
- type SockAddrInet6
- type SockAddrUnix
- type StatusMonitor
Constants ¶
View Source
const DefaultLogReadLimit = 1000
View Source
const UnixPathMax = 108
Variables ¶
View Source
var MonitorPoints = []string{ runsc.EnterSyscallByName("accept"), runsc.EnterSyscallByName("accept4"), runsc.EnterSyscallByName("bind"), runsc.ContainerStart, runsc.SentryClone, runsc.SentryExecve, runsc.SentryTaskExit, }
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 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 RunSCMonitor ¶
type RunSCMonitor struct {
Log *slog.Logger
Ports PortTracker
// contains filtered or unexported fields
}
func (*RunSCMonitor) Close ¶
func (r *RunSCMonitor) Close() error
func (*RunSCMonitor) Messages ¶
func (r *RunSCMonitor) Messages() uint64
func (*RunSCMonitor) NewClient ¶
func (r *RunSCMonitor) NewClient() (monitor.MessageHandler, error)
func (*RunSCMonitor) SetEndpoint ¶
func (r *RunSCMonitor) SetEndpoint(endpoint string)
func (*RunSCMonitor) WritePodInit ¶
func (r *RunSCMonitor) WritePodInit(path string) error
type SockAddrInet ¶
type SockAddrInet struct {
Family uint16
NetPort uint16
Addr InetAddr
// contains filtered or unexported fields
}
func (*SockAddrInet) Address ¶
func (s *SockAddrInet) Address() netip.Addr
func (*SockAddrInet) Port ¶
func (s *SockAddrInet) Port() int
func (*SockAddrInet) String ¶
func (s *SockAddrInet) String() string
type SockAddrInet6 ¶
type SockAddrInet6 struct {
Family uint16
NetPort uint16
Flowinfo uint32
Addr [16]byte
Scope_id uint32
}
SockAddrInet6 is struct sockaddr_in6, from uapi/linux/in6.h.
func (*SockAddrInet6) Address ¶
func (s *SockAddrInet6) Address() netip.Addr
func (*SockAddrInet6) Port ¶
func (s *SockAddrInet6) Port() int
func (*SockAddrInet6) String ¶
func (s *SockAddrInet6) String() string
type SockAddrUnix ¶
type SockAddrUnix struct {
Family uint16
Path [UnixPathMax]int8
}
SockAddrUnix is struct sockaddr_un, from uapi/linux/un.h.
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.