decoder

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSkipLabelSet = errors.New("this label set should be skipped")

ErrSkipLabelSet instructs exporter to skip label set

Functions

func Ksym

func Ksym(addr string) (string, error)

Ksym translates a kernel memory address into a kernel function name using `/proc/kallsyms`

Types

type Decoder

type Decoder interface {
	Decode([]byte, config.Decoder) ([]byte, error)
}

Decoder transforms byte field value into a byte value representing string to either use as an input for another Decoder or to use as the final label value for Prometheus metrics

type KSym

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

KSym is a decoder that transforms kernel address to a function name

func (*KSym) Decode

func (k *KSym) Decode(in []byte, conf config.Decoder) ([]byte, error)

Decode transforms kernel address to a function name

type MajorMinor

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

MajorMinor is a decoder that transforms minormajor device id into name

func (*MajorMinor) Decode

func (m *MajorMinor) Decode(in []byte, conf config.Decoder) ([]byte, error)

Decode transforms minormajor device id into device name like sda2

type Regexp

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

Regexp is a decoder that only allows inputs matching regexp

func (*Regexp) Decode

func (r *Regexp) Decode(in []byte, conf config.Decoder) ([]byte, error)

Decode only allows inputs matching regexp

type Set

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

Set is a set of Decoders that may be applied to produce a label

func NewSet

func NewSet() *Set

NewSet creates a Set with all known decoders

func (*Set) Decode

func (s *Set) Decode(in []byte, label config.Label) ([]byte, error)

Decode transforms input byte field into a string according to configuration

func (*Set) DecodeLabels

func (s *Set) DecodeLabels(in []byte, labels []config.Label) ([]string, error)

DecodeLabels transforms eBPF map key bytes into a list of label values according to configuration

type StaticMap

type StaticMap struct{}

StaticMap is a decoded that maps values according to a static map

func (*StaticMap) Decode

func (s *StaticMap) Decode(in []byte, conf config.Decoder) ([]byte, error)

Decode maps values according to a static map

type String

type String struct{}

String is a decoded that decodes strings coming from the kernel

func (*String) Decode

func (s *String) Decode(in []byte, conf config.Decoder) ([]byte, error)

Decode transforms byte slice from the kernel into string

type UInt

type UInt struct{}

UInt is a decoder that transforms unsigned integers into their string values

func (*UInt) Decode

func (u *UInt) Decode(in []byte, conf config.Decoder) ([]byte, error)

Decode transforms unsigned integers into their string values

Jump to

Keyboard shortcuts

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