config

package
v0.0.0-...-5b5755b Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name       string      `yaml:"name"`
	Metrics    Metrics     `yaml:"metrics"`
	PerfEvents []PerfEvent `yaml:"perf_events"`
	Kaddrs     []string    `yaml:"kaddrs"`
	BPFPath    string
}

Config describes how to configure and extract metrics

func ParseConfigs

func ParseConfigs(dir string, names []string) ([]Config, error)

type Counter

type Counter struct {
	Name           string        `yaml:"name"`
	Help           string        `yaml:"help"`
	PerfEventArray bool          `yaml:"perf_event_array"`
	FlushInterval  time.Duration `yaml:"flush_interval"`
	Labels         []Label       `yaml:"labels"`
}

Counter is a metric defining prometheus counter

type Decoder

type Decoder struct {
	Name         string            `yaml:"name"`
	StaticMap    map[string]string `yaml:"static_map"`
	Regexps      []string          `yaml:"regexps"`
	AllowUnknown bool              `yaml:"allow_unknown"`
}

Decoder defines how to decode value

type Histogram

type Histogram struct {
	Name             string              `yaml:"name"`
	Help             string              `yaml:"help"`
	BucketType       HistogramBucketType `yaml:"bucket_type"`
	BucketMultiplier float64             `yaml:"bucket_multiplier"`
	BucketMin        int                 `yaml:"bucket_min"`
	BucketMax        int                 `yaml:"bucket_max"`
	BucketKeys       []float64           `yaml:"bucket_keys"`
	Labels           []Label             `yaml:"labels"`
}

Histogram is a metric defining prometheus histogram

type HistogramBucketType

type HistogramBucketType string

HistogramBucketType is an enum to define how to interpret histogram

const (
	// HistogramBucketExp2 means histograms with power-of-two keys
	HistogramBucketExp2 HistogramBucketType = "exp2"
	// HistogramBucketLinear means histogram with linear keys
	HistogramBucketLinear HistogramBucketType = "linear"
	// HistogramBucketFixed means histogram with fixed user-defined keys
	HistogramBucketFixed HistogramBucketType = "fixed"
)

type Label

type Label struct {
	Name     string    `yaml:"name"`
	Size     uint      `yaml:"size"`
	Decoders []Decoder `yaml:"decoders"`
}

Label defines how to decode an element from eBPF map key with the list of decoders

type Metrics

type Metrics struct {
	Counters   []Counter   `yaml:"counters"`
	Histograms []Histogram `yaml:"histograms"`
}

Metrics is a collection of metrics attached to a program

type PerfEvent

type PerfEvent struct {
	Type            uint64 `yaml:"type"`
	Name            uint64 `yaml:"name"`
	Target          string `yaml:"target"`
	SamplePeriod    uint64 `yaml:"sample_period"`
	SampleFrequency uint64 `yaml:"sample_frequency"`
}

PerfEvent describes perf_event to attach to

Jump to

Keyboard shortcuts

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