aggregator

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2024 License: AGPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POD      = "pod"
	SVC      = "service"
	OUTBOUND = "outbound"
)
View Source
const (
	KAFKA = "kafka" // LOG_CONTEXT_KEY should match
	REDIS = "redis"
)
View Source
const (
	ADD    = "ADD"
	UPDATE = "UPDATE"
	DELETE = "DELETE"
)

Variables

This section is empty.

Functions

func IntToIPv4 added in v0.10.0

func IntToIPv4(ipaddr uint32) net.IP

IntToIPv4 converts IP address of version 4 from integer to net.IP representation.

Types

type AddressPair added in v0.10.0

type AddressPair struct {
	Saddr string `json:"saddr"`
	Sport uint16 `json:"sport"`
	Daddr string `json:"daddr"`
	Dport uint16 `json:"dport"`
}

type Aggregator

type Aggregator struct {
	// contains filtered or unexported fields
}

func NewAggregator

func NewAggregator(parentCtx context.Context, ct *cri.CRITool, k8sChan chan interface{},
	events chan interface{},
	procEvents chan interface{},
	tcpEvents chan interface{},
	tlsAttachSignalChan chan uint32,
	ds datastore.DataStore) *Aggregator

func (*Aggregator) AdvertiseDebugData added in v0.10.0

func (a *Aggregator) AdvertiseDebugData()

func (*Aggregator) Run

func (a *Aggregator) Run()

type ClusterInfo

type ClusterInfo struct {
	PodIPToPodUid         map[string]types.UID `json:"podIPToPodUid"`
	ServiceIPToServiceUid map[string]types.UID `json:"serviceIPToServiceUid"`

	// Pid -> SocketMap
	// pid -> fd -> {saddr, sport, daddr, dport}
	SocketMaps []*SocketMap // index symbolizes pid
	// contains filtered or unexported fields
}

func (*ClusterInfo) SignalSocketMapCreation added in v0.10.0

func (ci *ClusterInfo) SignalSocketMapCreation(pid uint32)

type Fd

type Fd struct {
	Fd   uint64
	Dest string

	SocketInode string
}

type FrameArrival added in v0.3.0

type FrameArrival struct {
	ClientHeadersFrameArrived bool
	ServerHeadersFrameArrived bool
	ServerDataFrameArrived    bool
	// contains filtered or unexported fields
}

type KafkaMessage added in v0.10.0

type KafkaMessage struct {
	TopicName string
	Partition int32
	Key       string
	Value     string
	Type      string // PUBLISH or CONSUME
}

type SockInfo

type SockInfo struct {
	Pid   uint32 `json:"pid"`
	Fd    uint64 `json:"fd"`
	Saddr string `json:"saddr"`
	Sport uint16 `json:"sport"`
	Daddr string `json:"daddr"`
	Dport uint16 `json:"dport"`
}

We need to keep track of the following in order to build find relationships between connections and pods/services

type SocketLine

type SocketLine struct {
	Values []*TimestampedSocket
	// contains filtered or unexported fields
}

func NewSocketLine

func NewSocketLine(ctx context.Context, pid uint32, fd uint64, fetch bool) *SocketLine

func (*SocketLine) AddValue

func (nl *SocketLine) AddValue(timestamp uint64, sockInfo *SockInfo)

func (*SocketLine) ClearAll added in v0.10.0

func (nl *SocketLine) ClearAll()

clears all socket history

func (*SocketLine) DeleteUnused

func (nl *SocketLine) DeleteUnused()

func (*SocketLine) GetValue

func (nl *SocketLine) GetValue(timestamp uint64) (*SockInfo, error)

type SocketMap

type SocketMap struct {
	M map[uint64]*SocketLine `json:"fdToSockLine"` // fd -> SockLine
	// contains filtered or unexported fields
}

type SocketMap

func (*SocketMap) ProcessSocketLineCreationRequests added in v0.10.0

func (sm *SocketMap) ProcessSocketLineCreationRequests()

only one worker can create socket lines for a particular process(socketmap)

func (*SocketMap) SignalSocketLine added in v0.10.0

func (sm *SocketMap) SignalSocketLine(ctx context.Context, fd uint64)

type TcpSocket

type TcpSocket struct {
	Inode  string
	SAddr  netaddr.IPPort
	DAddr  netaddr.IPPort
	Listen bool
}

type TimestampedSocket

type TimestampedSocket struct {
	Timestamp uint64    // unix timestamp in milliseconds
	LastMatch uint64    // last time this socket was matched on user space (request_time + process_latency)
	SockInfo  *SockInfo // write as nil on socket close
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL