option

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 12 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-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"

	KeyKmods = "kmods"

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

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

	KeyGenerateDocs = "generate-docs"
)

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 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

This section is empty.

Jump to

Keyboard shortcuts

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