exporter

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: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// PerfMap name
	// For these maps, we need to map the values of `type` into flags
	PerfMapExt4IoLatency       = "ext4latency"
	PerfMapExt4IoSize          = "ext4size"
	PerfMapExt4IoNumsOverThres = "ext4nums"
)
View Source
const (
	EbpfMetricNoType uint32 = iota
	// for ext4io
	EbpfMetricExt4IoRead
	EbpfMetricExt4IoWrite
	EbpfMetricExt4IoOpen
	EbpfMetricExt4IoFsync
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

Exporter is a ebpf_exporter instance implementing prometheus.Collector

func New

func New(configs []config.Config) (*Exporter, error)

New creates a new exporter with the provided config

func (*Exporter) Attach

func (e *Exporter) Attach() error

Attach injects eBPF into kernel and attaches necessary programs

func (*Exporter) Collect

func (e *Exporter) Collect(ch chan<- prometheus.Metric)

Collect satisfies prometheus.Collector interface and sends all metrics

func (*Exporter) CollectRaw

func (e *Exporter) CollectRaw() (map[string][]RawMetric, error)

func (*Exporter) Describe

func (e *Exporter) Describe(ch chan<- *prometheus.Desc)

Describe satisfies prometheus.Collector interface by sending descriptions for all metrics the exporter can possibly report

func (*Exporter) DescribeWrap

func (e *Exporter) DescribeWrap()

func (*Exporter) MapsHandler

func (e *Exporter) MapsHandler(w http.ResponseWriter, r *http.Request)

MapsHandler is a debug handler to print raw values of kernel maps

func (*Exporter) Reclaim

func (e *Exporter) Reclaim()

type PerfEventArraySink

type PerfEventArraySink struct {
	// contains filtered or unexported fields
}

func NewPerfEventArraySink

func NewPerfEventArraySink(decoders *decoder.Set, module *libbpfgo.Module, counterConfig config.Counter) *PerfEventArraySink

func (*PerfEventArraySink) Collect

func (s *PerfEventArraySink) Collect(ch chan<- prometheus.Metric)

func (*PerfEventArraySink) Describe

func (s *PerfEventArraySink) Describe(ch chan<- *prometheus.Desc)

type RawMetric

type RawMetric struct {
	Program    string  `json:"program"`
	Table      string  `json:"table"`
	PidAndFlag uint64  `json:"pid_and_flag"`
	Cmd        string  `json:"cmd"`
	Value      float64 `json:"value"`
}

func (*RawMetric) ExtractFlag

func (r *RawMetric) ExtractFlag() uint32

func (*RawMetric) ExtractPid

func (r *RawMetric) ExtractPid() uint32

Jump to

Keyboard shortcuts

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