collector

package
v0.0.0-...-0631643 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OutgoingConnection = ConnDirection("outgoing")
	IncomingConnection = ConnDirection("incoming")
)
View Source
var (
	// copied from: https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/nf_conntrack_tcp.h#L9
	TCP_CONNTRACK_SYN_SENT    uint8 = 1
	TCP_CONNTRACK_ESTABLISHED uint8 = 3
	TCP_CONNTRACK_CLOSE_WAIT  uint8 = 5
	TCP_CONNTRACK_LAST_ACK    uint8 = 6
	TCP_CONNTRACK_TIME_WAIT   uint8 = 7

	// copied from: https://github.com/torvalds/linux/blob/0d81a3f29c0afb18ba2b1275dcccf21e0dd4da38/include/uapi/linux/in.h#L28
	IPPROTO_TCP uint8 = 6
	IPPROTO_UDP uint8 = 17
)

Functions

func NewCIDRClassifier

func NewCIDRClassifier(cidrsLabels map[string]string) (*cidrClassifier, error)

Types

type Conn

type Conn struct {
	ID          uint32
	OriginIP    string
	DestIP      string
	OriginPort  uint16
	DestPort    uint16
	State       string
	Protocol    string
	OriginBytes uint64
	ReplyBytes  uint64
}

type ConnDirection

type ConnDirection string

type Conntrack

type Conntrack func() ([]*Conn, error)

func NewConntrack

func NewConntrack(protocol string) Conntrack

type ConntrackCollector

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

func New

func New(engine workload.Engine, conntrack Conntrack, workloadLabels []string, dnsCache DNSCache, classifier *cidrClassifier) (*ConntrackCollector, error)

func (*ConntrackCollector) Collect

func (c *ConntrackCollector) Collect(ch chan<- prometheus.Metric)

func (*ConntrackCollector) Describe

func (c *ConntrackCollector) Describe(ch chan<- *prometheus.Desc)

type DNSCache

type DNSCache interface {
	ResolveIP(ip string) (addr string)
}

Jump to

Keyboard shortcuts

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