config

package
v0.0.0-...-81e0219 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BPFEvent

type BPFEvent struct {
	// Type of event this is. Either Kprobe, Kretprobe, etc...
	Type string `yaml:"type"`
	// Name of the function to load into eBPF VM for this event
	LoadFunc string `yaml:"loadFunc"`
	// What eBPF object we're attaching this function to
	AttachTo string `yaml:"attachTo"`
}

type BPFOutput

type BPFOutput struct {
	// ID of the table to watch
	Id string `yaml:"id"`
	// What table type this is
	Type string `yaml:"type"`
	// If not perf output, how often to poll output
	Poll string `yaml:"poll"`
	// Should we clear hash on poll
	Clear bool `yaml:"clear"`
	// Hash keys format
	Key BPFOutputFormat `yaml:"key"`
	// Format of the struct
	Format []BPFOutputFormat `yaml:"format"`
}

type BPFOutputFormat

type BPFOutputFormat struct {
	// Name of the value in the struct
	Name string `yaml:"name"`
	// Type of the value
	Type string `yaml:"type"`
	// Golang format string to save value as. Defaults to %v
	FormatString string `yaml:"formatString"`
	// Set if this should be a tag
	IsTag bool `yaml:"isTag"`
	// Set if this field is an IP; assumed to be a tag
	IsIP bool `yaml:"isIP"`
	// Filter to apply to values
	Filter interface{} `yaml:"filter"`
	// Filters get compiled by ParseConfig and iterated over to check
	CompiledFilter types.GomegaMatcher
	// Types get compiled by ParseConfig and iterated over to check
	CompiledType reflect.Type
}

type BPFProgram

type BPFProgram struct {
	// Source of the eBPF program to load in. Will be compilied by BCC into eBPF
	// byte code. Should point to a .c file
	Source string `yaml:"source"`
	// Events to trace with this eBPF program
	Events []BPFEvent `yaml:"events"`
	// Maps/tables to poll for this program. Should have the output data from the
	// tracing program
	Outputs []BPFOutput `yaml:"outputs"`
}

type GlobalOptions

type GlobalOptions struct {
	// Socket we're writing data out to
	SocketPath string `yaml:"socketPath"`
	// Format for verbose output.
	VerboseFormat string `yaml:"verboseFormat"`
	// Log measurements to stdout. Overwritten by command line value if set
	Verbose bool `yaml:"verbose"`
	// Maximum number of times to attempt socket communication
	MaxRetryCount int `yaml:"maxRetryCount"`
	// Use exponential backoff. Enabled by default
	RetryExponentialBackoff bool `yaml:"retryExponentialBackoff"`
	// Time in golang format to delay retries. Set to 100ms by default
	RetryDelay string `yaml:"retryDelay"`
	// Compiled retry as time.Duration
	CompiledRetryDelay time.Duration
}

type GreggdConfig

type GreggdConfig struct {
	// Store global options for development
	Globals GlobalOptions
	// List of the eBPF programs managed by this app
	Programs []BPFProgram
}

func ParseConfig

func ParseConfig(input io.Reader) (*GreggdConfig, error)

type SocketInput

type SocketInput struct {
	MeasurementName string
	Fields          map[string]string
	Tags            map[string]string
	KeyData         []byte
	KeyType         reflect.Type
	DataBytes       []byte
	DataType        reflect.Type
	OutputConfig    *BPFOutput
}

Jump to

Keyboard shortcuts

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