Documentation
¶
Overview ¶
Package option provides global singletons for storing configuration and variables used in Tetragon.
Index ¶
- Constants
- Variables
- func AddFlags(flags *pflag.FlagSet)
- func AncestorsEnabled(eventType tetragon.EventType) bool
- func CgroupRateEnabled() bool
- func CreateProcessLabels(namespace, workload, pod, binary string) *metrics.ProcessLabels
- func DefaultLabelFilter() metrics.LabelFilter
- func InClusterControlPlaneEnabled() bool
- func K8SControlPlaneEnabled() bool
- func ParseMetricsLabelFilter(labelsString string) []string
- func ReadAndSetFlags() error
- func ReadConfigDir(path string) error
- func ReadConfigFile(path string, file string) error
- func ReadDirConfig(dirName string) (map[string]interface{}, error)
- type CgroupRate
- type UsernameMetadaCode
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" KeyProcessCacheGCInterval = "process-cache-gc-interval" KeyForceSmallProgs = "force-small-progs" KeyForceLargeProgs = "force-large-progs" KeyClusterName = "cluster-name" KeyLogLevel = "log-level" KeyLogFormat = "log-format" KeyEnableK8sAPI = "enable-k8s-api" KeyK8sKubeConfigPath = "k8s-kubeconfig-path" KeyK8sControlPlaneRetry = "k8s-controlplane-retry" KeyEnablePodAnnotations = "enable-pod-annotations" KeyMetricsServer = "metrics-server" KeyMetricsLabelFilter = "metrics-label-filter" KeyServerAddress = "server-address" KeyGopsAddr = "gops-address" KeyEnableAncestors = "enable-ancestors" KeyEnableProcessCred = "enable-process-cred" KeyEnableProcessNs = "enable-process-ns" KeyTracingPolicy = "tracing-policy" KeyTracingPolicyDir = "tracing-policy-dir" KeyCpuProfile = "cpuprofile" KeyMemProfile = "memprofile" KeyPprofAddr = "pprof-address" 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" KeyUsePerfRingBuffer = "use-perf-ring-buffer" KeyRBSize = "rb-size" KeyRBSizeTotal = "rb-size-total" KeyRBQueueSize = "rb-queue-size" KeyEventQueueSize = "event-queue-size" KeyReleasePinnedBPF = "release-pinned-bpf" KeyEnablePolicyFilter = "enable-policy-filter" KeyEnablePolicyFilterCgroupMap = "enable-policy-filter-cgroup-map" 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" 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" KeyEnableCgTrackerID = "enable-cgtrackerid" KeyEventCacheRetries = "event-cache-retries" KeyEventCacheRetryDelay = "event-cache-retry-delay" KeyCompatibilitySyscall64SizeType = "enable-compatibility-syscall64-size-type" KeyExecveMapEntries = "execve-map-entries" KeyExecveMapSize = "execve-map-size" )
Variables ¶
View Source
var ( // Config contains all the configuration used by Tetragon. Config = config{ ProcFS: "/proc", LogOpts: make(map[string]string), MetricsLabelFilter: DefaultLabelFilter(), EventCacheNumRetries: defaults.DefaultEventCacheNumRetries, EventCacheRetryDelay: defaults.DefaultEventCacheRetryDelay, } )
Functions ¶
func AncestorsEnabled ¶ added in v1.5.0
AncestorsEnabled returns the value of the configuration option responsible for enabling process ancestors for events with the specified eventType. If events with the specified eventType don't support ancestors, false is returned.
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:
- Define a granular metric with ProcessLabels type parameter (see pkg/metrics/granularmetric.go).
- When calling WithLabelValues, pass a ProcessLabels struct created with CreateProcessLabels.
func DefaultLabelFilter ¶ added in v1.1.0
func DefaultLabelFilter() metrics.LabelFilter
func InClusterControlPlaneEnabled ¶ added in v1.6.0
func InClusterControlPlaneEnabled() bool
func K8SControlPlaneEnabled ¶ added in v1.6.0
func K8SControlPlaneEnabled() bool
func ParseMetricsLabelFilter ¶ added in v1.0.0
func ReadAndSetFlags ¶ added in v1.0.0
func ReadAndSetFlags() error
func ReadConfigDir ¶ added in v0.11.0
func ReadConfigFile ¶ added in v0.11.0
func ReadDirConfig ¶
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
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
Click to show internal directories.
Click to hide internal directories.