monitor

package
v10.25.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMonitor

func NewMonitor(opts ...Options) *config.MonitorConfig

NewMonitor provides a configuration for monitors.

Types

type CNIMonitorOption

type CNIMonitorOption func(*cnimonitor.Config)

CNIMonitorOption is provided using functional arguments.

func SubOptionMonitorCNIExtractor

func SubOptionMonitorCNIExtractor(extractor extractors.EventMetadataExtractor) CNIMonitorOption

SubOptionMonitorCNIExtractor provides a way to specify metadata extractor for CNI monitors.

type DockerMonitorOption

type DockerMonitorOption func(*dockermonitor.Config)

DockerMonitorOption is provided using functional arguments.

func SubOptionMonitorDockerExtractor

func SubOptionMonitorDockerExtractor(extractor extractors.DockerMetadataExtractor) DockerMonitorOption

SubOptionMonitorDockerExtractor provides a way to specify metadata extractor for docker.

func SubOptionMonitorDockerFlags

func SubOptionMonitorDockerFlags(syncAtStart, killContainerOnPolicyError bool) DockerMonitorOption

SubOptionMonitorDockerFlags provides a way to specify configuration flags info for docker.

func SubOptionMonitorDockerSocket

func SubOptionMonitorDockerSocket(socketType, socketAddress string) DockerMonitorOption

SubOptionMonitorDockerSocket provides a way to specify socket info for docker.

type Implementation

type Implementation interface {

	// Run starts the monitor implementation.
	Run(ctx context.Context) error

	// SetupConfig provides a configuration to implmentations. Every implmentation
	// can have its own config type.
	SetupConfig(registerer registerer.Registerer, cfg interface{}) error

	// SetupHandlers sets up handlers for monitors to invoke for various events such as
	// processing unit events and synchronization events. This will be called before Start()
	// by the consumer of the monitor
	SetupHandlers(c *config.ProcessorConfig)

	// Resync should resynchronize PUs. This should be done while starting up.
	Resync(ctx context.Context) error
}

Implementation for a monitor.

type KubernetesMonitorOption

type KubernetesMonitorOption func(*kubernetesmonitor.Config)

KubernetesMonitorOption is provided using functional arguments.

func SubOptionMonitorKubernetesDockerExtractor

func SubOptionMonitorKubernetesDockerExtractor(extractor extractors.DockerMetadataExtractor) KubernetesMonitorOption

SubOptionMonitorKubernetesDockerExtractor provides a way to specify metadata extractor for docker.

func SubOptionMonitorKubernetesExtractor

func SubOptionMonitorKubernetesExtractor(extractor extractors.KubernetesMetadataExtractorType) KubernetesMonitorOption

SubOptionMonitorKubernetesExtractor provides a way to specify metadata extractor for Kubernetes

func SubOptionMonitorKubernetesHostPod

func SubOptionMonitorKubernetesHostPod(enableHostPods bool) KubernetesMonitorOption

SubOptionMonitorKubernetesHostPod provides a way to specify if we want to activate Pods launched in host mode.

func SubOptionMonitorKubernetesKubeconfig

func SubOptionMonitorKubernetesKubeconfig(kubeconfig string) KubernetesMonitorOption

SubOptionMonitorKubernetesKubeconfig provides a way to specify a kubeconfig to use to connect to Kubernetes. In case of an in-cluter config, leave the kubeconfig field blank

func SubOptionMonitorKubernetesNodename

func SubOptionMonitorKubernetesNodename(nodename string) KubernetesMonitorOption

SubOptionMonitorKubernetesNodename provides a way to specify the kubernetes node name. This is useful for filtering

type LinuxMonitorOption

type LinuxMonitorOption func(*linuxmonitor.Config)

LinuxMonitorOption is provided using functional arguments.

func SubOptionMonitorLinuxExtractor

func SubOptionMonitorLinuxExtractor(extractor extractors.EventMetadataExtractor) LinuxMonitorOption

SubOptionMonitorLinuxExtractor provides a way to specify metadata extractor for linux monitors.

type Monitor

type Monitor interface {

	// Start starts the monitor.
	Run(ctx context.Context) error

	// UpdateConfiguration updates the configuration of the monitor
	UpdateConfiguration(ctx context.Context, config *config.MonitorConfig) error

	// Resync requests to the monitor to do a resync.
	Resync(ctx context.Context) error
}

A Monitor is an interface implmented to start/stop monitors.

func NewMonitors

func NewMonitors(opts ...Options) (Monitor, error)

NewMonitors instantiates all/any combination of monitors supported.

type Options

type Options func(*config.MonitorConfig)

Options is provided using functional arguments.

func OptionApplicationProxyPort

func OptionApplicationProxyPort(proxyPort int) Options

OptionApplicationProxyPort is to provide the application proxy port

func OptionCollector

func OptionCollector(c collector.EventCollector) Options

OptionCollector provide a way to add to the docker monitor the collector instance

func OptionMergeTags

func OptionMergeTags(tags []string) Options

OptionMergeTags provides a way to add merge tags to be used with New().

func OptionMonitorCNI

func OptionMonitorCNI(
	opts ...CNIMonitorOption,
) Options

OptionMonitorCNI provides a way to add a cni monitor and related configuration to be used with New().

func OptionMonitorDocker

func OptionMonitorDocker(opts ...DockerMonitorOption) Options

OptionMonitorDocker provides a way to add a docker monitor and related configuration to be used with New().

func OptionMonitorKubernetes

func OptionMonitorKubernetes(opts ...KubernetesMonitorOption) Options

OptionMonitorKubernetes provides a way to add a docker monitor and related configuration to be used with New().

func OptionMonitorLinuxHost

func OptionMonitorLinuxHost(
	opts ...LinuxMonitorOption,
) Options

OptionMonitorLinuxHost provides a way to add a linux host monitor and related configuration to be used with New().

func OptionMonitorLinuxProcess

func OptionMonitorLinuxProcess(
	opts ...LinuxMonitorOption,
) Options

OptionMonitorLinuxProcess provides a way to add a linux process monitor and related configuration to be used with New().

func OptionMonitorUID

func OptionMonitorUID(
	opts ...UIDMonitorOption,
) Options

OptionMonitorUID provides a way to add a UID monitor and related configuration to be used with New().

func OptionPolicyResolver

func OptionPolicyResolver(p policy.Resolver) Options

OptionPolicyResolver provides a way to add to the docker monitor the policy resolver instance

type UIDMonitorOption

type UIDMonitorOption func(*uidmonitor.Config)

UIDMonitorOption is provided using functional arguments.

func SubOptionMonitorUIDExtractor

func SubOptionMonitorUIDExtractor(extractor extractors.EventMetadataExtractor) UIDMonitorOption

SubOptionMonitorUIDExtractor provides a way to specify metadata extractor for UID monitors.

Directories

Path Synopsis
internal
cni
docker/mockdocker
Package mockdocker is a generated GoMock package.
Package mockdocker is a generated GoMock package.
uid
Package mockmonitor is a generated GoMock package.
Package mockmonitor is a generated GoMock package.
mockprocessor
Package mockprocessor is a generated GoMock package.
Package mockprocessor is a generated GoMock package.
remoteapi

Jump to

Keyboard shortcuts

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