decoder

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// when fail get kubernetes labe fail use DefaultKubeContextValue  as default
	DefaultKubeContextValue       = "unknown"
	MaxCachePidKubeInfoTimeSecond = 30
)

Variables

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

ErrSkipLabelSet instructs exporter to skip label set

Functions

This section is empty.

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 InetIP

type InetIP struct{}

InetIP is a decoder that transforms an ip byte representation into a string

func (*InetIP) Decode

func (i *InetIP) Decode(in []byte, conf config.Decoder) ([]byte, error)

Decode transforms an ip byte representation into a string

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 KubeContainerName

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

KubeContainerName is a decoder that transforms pid representation into kubernetes pod container name

func (*KubeContainerName) Decode

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

Decode transforms pid representation into a kubernetes container name as string

type KubeContext

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

KubeContext kubernetes context info cache

type KubeInfo

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

KubeInfo kubernetes context info

type KubePodName

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

KubePodName is a decoder that transforms pid representation into kubernetes pod name

func (*KubePodName) Decode

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

Decode transforms pid representation into a kubernetes pod name as string

type KubePodNamespace

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

KubePodNamespace is a decoder that transforms pid representation into kubernetes pod namespace

func (*KubePodNamespace) Decode

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

Decode transforms pid representation into a kubernetes namespace and pod as string

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