checks

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Connections is a singleton ConnectionsCheck.
	Connections = &ConnectionsCheck{}

	// LocalResolver is a singleton LocalResolver
	LocalResolver = &resolver.LocalResolver{}

	// ErrTracerStillNotInitialized signals that the tracer is _still_ not ready, so we shouldn't log additional errors
	ErrTracerStillNotInitialized = errors.New("remote tracer is still not initialized")
)

All is all the singleton check instances.

View Source
var Container = &ContainerCheck{}

Container is a singleton ContainerCheck.

View Source
var Pod = &PodCheck{}

Pod is a singleton PodCheck.

View Source
var Process = &ProcessCheck{}

Process is a singleton ProcessCheck.

View Source
var RTContainer = &RTContainerCheck{}

RTContainer is a singleton RTContainerCheck.

View Source
var RTProcess = &RTProcessCheck{}

RTProcess is a singleton RTProcessCheck.

Functions

func CollectSystemInfo

func CollectSystemInfo(cfg *config.AgentConfig) (*model.SystemInfo, error)

CollectSystemInfo collects a set of system-level information that will not change until a restart. This bit of information should be passed along with the process messages.

Types

type Check

type Check interface {
	Init(cfg *config.AgentConfig, info *model.SystemInfo)
	Name() string
	RealTime() bool
	Run(cfg *config.AgentConfig, groupID int32) ([]model.MessageBody, error)
}

Check is an interface for Agent checks that collect data. Each check returns a specific MessageBody type that will be published to the intake endpoint or processed in another way (e.g. printed for debugging). Before checks are used you must called Init.

type ConnectionsCheck

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

ConnectionsCheck collects statistics about live TCP and UDP connections.

func (*ConnectionsCheck) Init

Init initializes a ConnectionsCheck instance.

func (*ConnectionsCheck) Name

func (c *ConnectionsCheck) Name() string

Name returns the name of the ConnectionsCheck.

func (*ConnectionsCheck) RealTime

func (c *ConnectionsCheck) RealTime() bool

RealTime indicates if this check only runs in real-time mode.

func (*ConnectionsCheck) Run

func (c *ConnectionsCheck) Run(cfg *config.AgentConfig, groupID int32) ([]model.MessageBody, error)

Run runs the ConnectionsCheck to collect the live TCP connections on the system. Currently only linux systems are supported as eBPF is used to gather this information. For each connection we'll return a `model.Connection` that will be bundled up into a `CollectorConnections`. See agent.proto for the schema of the message and models.

type ContainerCheck

type ContainerCheck struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ContainerCheck is a check that returns container metadata and stats.

func (*ContainerCheck) Init

func (c *ContainerCheck) Init(cfg *config.AgentConfig, info *model.SystemInfo)

Init initializes a ContainerCheck instance.

func (*ContainerCheck) Name

func (c *ContainerCheck) Name() string

Name returns the name of the ProcessCheck.

func (*ContainerCheck) RealTime

func (c *ContainerCheck) RealTime() bool

RealTime indicates if this check only runs in real-time mode.

func (*ContainerCheck) Run

func (c *ContainerCheck) Run(cfg *config.AgentConfig, groupID int32) ([]model.MessageBody, error)

Run runs the ContainerCheck to collect a list of running ctrList and the stats for each container.

type PodCheck

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

PodCheck is a check that returns container metadata and stats.

func (*PodCheck) Init

func (c *PodCheck) Init(cfg *config.AgentConfig, info *model.SystemInfo)

Init initializes a PodCheck instance.

func (*PodCheck) Name

func (c *PodCheck) Name() string

Name returns the name of the ProcessCheck.

func (*PodCheck) RealTime

func (c *PodCheck) RealTime() bool

RealTime indicates if this check only runs in real-time mode.

func (*PodCheck) Run

func (c *PodCheck) Run(cfg *config.AgentConfig, groupID int32) ([]model.MessageBody, error)

Run runs the PodCheck to collect a list of running pods

type ProcessCheck

type ProcessCheck struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ProcessCheck collects full state, including cmdline args and related metadata, for live and running processes. The instance will store some state between checks that will be used for rates, cpu calculations, etc.

func (*ProcessCheck) Init

func (p *ProcessCheck) Init(_ *config.AgentConfig, info *model.SystemInfo)

Init initializes the singleton ProcessCheck.

func (*ProcessCheck) Name

func (p *ProcessCheck) Name() string

Name returns the name of the ProcessCheck.

func (*ProcessCheck) RealTime

func (p *ProcessCheck) RealTime() bool

RealTime indicates if this check only runs in real-time mode.

func (*ProcessCheck) Run

func (p *ProcessCheck) Run(cfg *config.AgentConfig, groupID int32) ([]model.MessageBody, error)

Run runs the ProcessCheck to collect a list of running processes and relevant stats for each. On most POSIX systems this will use a mix of procfs and other OS-specific APIs to collect this information. The bulk of this collection is abstracted into the `gopsutil` library. Processes are split up into a chunks of at most 100 processes per message to limit the message size on intake. See agent.proto for the schema of the message and models used.

type RTContainerCheck

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

RTContainerCheck collects numeric statistics about live ctrList.

func (*RTContainerCheck) Init

func (r *RTContainerCheck) Init(_ *config.AgentConfig, sysInfo *model.SystemInfo)

Init initializes a RTContainerCheck instance.

func (*RTContainerCheck) Name

func (r *RTContainerCheck) Name() string

Name returns the name of the RTContainerCheck.

func (*RTContainerCheck) RealTime

func (r *RTContainerCheck) RealTime() bool

RealTime indicates if this check only runs in real-time mode.

func (*RTContainerCheck) Run

func (r *RTContainerCheck) Run(cfg *config.AgentConfig, groupID int32) ([]model.MessageBody, error)

Run runs the real-time container check getting container-level stats from the Cgroups and Docker APIs.

type RTProcessCheck

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

RTProcessCheck collects numeric statistics about the live processes. The instance stores state between checks for calculation of rates and CPU.

func (*RTProcessCheck) Init

func (r *RTProcessCheck) Init(_ *config.AgentConfig, info *model.SystemInfo)

Init initializes a new RTProcessCheck instance.

func (*RTProcessCheck) Name

func (r *RTProcessCheck) Name() string

Name returns the name of the RTProcessCheck.

func (*RTProcessCheck) RealTime

func (r *RTProcessCheck) RealTime() bool

RealTime indicates if this check only runs in real-time mode.

func (*RTProcessCheck) Run

func (r *RTProcessCheck) Run(cfg *config.AgentConfig, groupID int32) ([]model.MessageBody, error)

Run runs the RTProcessCheck to collect statistics about the running processes. On most POSIX systems these statistics are collected from procfs. The bulk of this collection is abstracted into the `gopsutil` library. Processes are split up into a chunks of at most 100 processes per message to limit the message size on intake. See agent.proto for the schema of the message and models used.

Jump to

Keyboard shortcuts

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