collector

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentTimeGetter added in v0.3.0

func CurrentTimeGetter() func() time.Time

Types

type Collector

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

func New

func New(
	cfg Config,
	log logrus.FieldLogger,
	kubeWatcher kube.Watcher,
	conntracker conntrack.Client,
	currentTimeGetter func() time.Time,
) *Collector

func (*Collector) GetMetricsChan

func (c *Collector) GetMetricsChan() <-chan *PodNetworkMetric

func (*Collector) Start

func (c *Collector) Start(ctx context.Context) error

type Config

type Config struct {
	// ReadInterval used for conntrack records scrape.
	ReadInterval time.Duration
	// FlushInterval used for aggregated metrics export.
	FlushInterval time.Duration
	// CleanupInterval used to remove expired conntrack and pod metrics records.
	CleanupInterval time.Duration
	// NodeName is current node name on which egressd is running.
	NodeName string
	// ExcludeNamespaces allows to exclude namespaces. Input is comma separated string.
	ExcludeNamespaces string
	// MetricBufferSize export channel buffer size.
	MetricBufferSize int
}

type PodNetworkMetric

type PodNetworkMetric struct {
	SrcIP        string `json:"src_ip"`
	SrcPod       string `json:"src_pod,omitempty"`
	SrcNamespace string `json:"src_namespace,omitempty"`
	SrcNode      string `json:"src_node,omitempty"`
	SrcZone      string `json:"src_zone,omitempty"`
	DstIP        string `json:"dst_ip"`
	DstIPType    string `json:"dst_ip_type"`
	DstPod       string `json:"dst_pod,omitempty"`
	DstNamespace string `json:"dst_namespace,omitempty"`
	DstNode      string `json:"dst_node,omitempty"`
	DstZone      string `json:"dst_zone,omitempty"`
	TxBytes      uint64 `json:"tx_bytes,omitempty"`
	TxPackets    uint64 `json:"tx_packets,omitempty"`
	RxBytes      uint64 `json:"rx_bytes,omitempty"`
	RxPackets    uint64 `json:"rx_packets,omitempty"`
	Proto        string `json:"proto"`
	TS           uint64 `json:"ts,omitempty"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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