option

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package option provides global singletons for storing configuration and variables used in Tetragon.

Index

Constants

View Source
const (
	KeyConfigDir        = "config-dir"
	KeyDebug            = "debug"
	KeyHubbleLib        = "bpf-lib"
	KeyBTF              = "btf"
	KeyProcFS           = "procfs"
	KeyKernelVersion    = "kernel"
	KeyVerbosity        = "verbose"
	KeyProcessCacheSize = "process-cache-size"
	KeyDataCacheSize    = "data-cache-size"
	KeyForceSmallProgs  = "force-small-progs"
	KeyForceLargeProgs  = "force-large-progs"

	KeyLogLevel  = "log-level"
	KeyLogFormat = "log-format"

	KeyEnableK8sAPI           = "enable-k8s-api"
	KeyK8sKubeConfigPath      = "k8s-kubeconfig-path"
	KeyEnableProcessAncestors = "enable-process-ancestors"

	KeyMetricsServer      = "metrics-server"
	KeyMetricsLabelFilter = "metrics-label-filter"
	KeyServerAddress      = "server-address"
	KeyGopsAddr           = "gops-address"
	KeyEnableProcessCred  = "enable-process-cred"
	KeyEnableProcessNs    = "enable-process-ns"
	KeyTracingPolicy      = "tracing-policy"
	KeyTracingPolicyDir   = "tracing-policy-dir"

	KeyCpuProfile          = "cpuprofile"
	KeyMemProfile          = "memprofile"
	KeyPprofAddr           = "pprof-address"
	KeyDeprecatedPprofAddr = "pprof-addr"

	KeyExportFilename             = "export-filename"
	KeyExportFileMaxSizeMB        = "export-file-max-size-mb"
	KeyExportFileRotationInterval = "export-file-rotation-interval"
	KeyExportFileMaxBackups       = "export-file-max-backups"
	KeyExportFileCompress         = "export-file-compress"
	KeyExportRateLimit            = "export-rate-limit"
	KeyExportFilePerm             = "export-file-perm"

	KeyEnableExportAggregation     = "enable-export-aggregation"
	KeyExportAggregationWindowSize = "export-aggregation-window-size"
	KeyExportAggregationBufferSize = "export-aggregation-buffer-size"

	KeyExportAllowlist = "export-allowlist"
	KeyExportDenylist  = "export-denylist"

	KeyFieldFilters     = "field-filters"
	KeyRedactionFilters = "redaction-filters"

	KeyNetnsDir = "netns-dir"

	KeyDisableKprobeMulti = "disable-kprobe-multi"
	KeyDisableUprobeMulti = "disable-uprobe-multi"

	KeyRBSize      = "rb-size"
	KeyRBSizeTotal = "rb-size-total"
	KeyRBQueueSize = "rb-queue-size"

	KeyEventQueueSize = "event-queue-size"

	KeyReleasePinnedBPF = "release-pinned-bpf"

	KeyEnablePolicyFilter      = "enable-policy-filter"
	KeyEnablePolicyFilterDebug = "enable-policy-filter-debug"

	KeyEnablePidSetFilter = "enable-pid-set-filter"

	KeyEnableMsgHandlingLatency = "enable-msg-handling-latency"

	KeyEnablePodInfo          = "enable-pod-info"
	KeyEnableTracingPolicyCRD = "enable-tracing-policy-crd"

	KeyExposeStackAddresses  = "expose-stack-addresses"
	KeyExposeKernelAddresses = "expose-kernel-addresses"

	KeyGenerateDocs = "generate-docs"

	KeyCgroupRate = "cgroup-rate"

	KeyUsernameMetadata = "username-metadata"

	KeyHealthServerAddress = "health-server-address"
	KeyHealthTimeInterval  = "health-server-interval"

	KeyBpfDir = "bpf-dir"

	KeyKeepSensorsOnExit = "keep-sensors-on-exit"

	KeyEnableCRI   = "enable-cri"
	KeyCRIEndpoint = "cri-endpoint"

	KeyEnableCgIDmap      = "enable-cgidmap"
	KeyEnableCgIDmapDebug = "enable-cgidmap-debug"
)

Variables

View Source
var (

	// Config contains all the configuration used by Tetragon.
	Config = config{

		ProcFS: "/proc",

		LogOpts: make(map[string]string),

		MetricsLabelFilter: DefaultLabelFilter(),
	}
)

Functions

func AddFlags added in v1.0.0

func AddFlags(flags *pflag.FlagSet)

func CgroupRateEnabled added in v1.2.0

func CgroupRateEnabled() bool

func CreateProcessLabels added in v1.1.0

func CreateProcessLabels(namespace, workload, pod, binary string) *metrics.ProcessLabels

CreateProcessLabels creates a new ProcessLabels struct with the global labels filter applied. To have a metric respect the labels filter, we have to:

  1. Define a granular metric with ProcessLabels type parameter (see pkg/metrics/granularmetric.go).
  2. When calling WithLabelValues, pass a ProcessLabels struct created with CreateProcessLabels.

func DefaultLabelFilter added in v1.1.0

func DefaultLabelFilter() metrics.LabelFilter

func ParseMetricsLabelFilter added in v1.0.0

func ParseMetricsLabelFilter(labelsString string) []string

func ReadAndSetFlags added in v1.0.0

func ReadAndSetFlags() error

func ReadConfigDir added in v0.11.0

func ReadConfigDir(path string) error

func ReadConfigFile added in v0.11.0

func ReadConfigFile(path string, file string) error

func ReadDirConfig

func ReadDirConfig(dirName string) (map[string]interface{}, error)

ReadDirConfig reads the given directory and returns a map that maps the filename to the contents of that file.

Types

type CgroupRate added in v1.2.0

type CgroupRate struct {
	Events   uint64
	Interval uint64
}

func ParseCgroupRate added in v1.2.0

func ParseCgroupRate(rate string) CgroupRate

type UsernameMetadaCode added in v1.1.1

type UsernameMetadaCode int
const (
	// Username metadata collection modes
	USERNAME_METADATA_DISABLED UsernameMetadaCode = iota
	USERNAME_METADATA_UNIX     UsernameMetadaCode = 1 // Username from /etc/passwd
)

func (UsernameMetadaCode) String added in v1.1.1

func (op UsernameMetadaCode) String() string

Jump to

Keyboard shortcuts

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