config

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 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"`
	Tracing Tracing  `yaml:"tracing"`
	Kaddrs  []string `yaml:"kaddrs"`
	BPFPath string
}

Config describes how to configure and extract metrics

func ParseConfigs

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

ParseConfigs parses the named configs from the provided configs directory

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"
	// HistogramBucketExp2WithZero means histograms with power-of-two keys where the first key is for zero
	HistogramBucketExp2WithZero HistogramBucketType = "exp2zero"
	// 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"`
	Padding  uint      `yaml:"padding"`
	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 Span added in v2.4.0

type Span struct {
	RingBuf string  `yaml:"ringbuf"`
	Name    string  `yaml:"name"`
	Service string  `yaml:"service"`
	Labels  []Label `yaml:"labels"`
}

Span describes how a span is decoded from the kernel

type Tracing added in v2.4.0

type Tracing struct {
	Spans []Span `yaml:"spans"`
}

Tracing is a collection of spans attached to a program

Jump to

Keyboard shortcuts

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