decoder

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

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

This section is empty.

Types

type CGroup

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

CGroup is a decoder that transforms cgroup id to path in cgroupfs

func NewCgroupDecoder added in v2.3.0

func NewCgroupDecoder() (*CGroup, error)

NewCgroupDecoder creates a new cgroup decoder

func (*CGroup) Decode

func (c *CGroup) Decode(in []byte, _ config.Decoder) ([]byte, error)

Decode transforms cgroup id to path in cgroupfs

type Decoder

type Decoder interface {
	Decode(in []byte, conf 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 Dname

type Dname struct{}

Dname is a decoder that decodes DNS qname wire format

func (*Dname) Decode

func (d *Dname) Decode(in []byte, _ config.Decoder) ([]byte, error)

Decode transforms wire format into string

type Errno added in v2.4.1

type Errno struct{}

Errno is a decoder that transforms unsigned errno integers into their string values

func (*Errno) Decode added in v2.4.1

func (e *Errno) Decode(in []byte, _ config.Decoder) ([]byte, error)

Decode transforms unsigned errno integers into their string values

type Hex added in v2.4.0

type Hex struct{}

Hex is a decoder that decodes raw bytes into their hex string representation

func (*Hex) Decode added in v2.4.0

func (u *Hex) Decode(in []byte, _ config.Decoder) ([]byte, error)

Decode transforms bytes into their hex string representation

type IfName added in v2.3.1

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

IfName is a decoder that transforms a network interface index into its name.

func (*IfName) Decode added in v2.3.1

func (i *IfName) Decode(in []byte, _ config.Decoder) ([]byte, error)

Decode transforms a network interface index into a name like "ens10".

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, _ config.Decoder) ([]byte, error)

Decode transforms an ip byte representation into a string

type KStack added in v2.3.0

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

KStack is a decoder that transforms an array of kernel frame addresses to a newline separated stack of symbols

func (*KStack) Decode added in v2.3.0

func (k *KStack) Decode(in []byte, _ config.Decoder) ([]byte, error)

Decode transforms an array of kernel frame addresses to a newline separated stack of symbols

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, _ 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, _ config.Decoder) ([]byte, error)

Decode transforms minormajor device id into device name like sda2

type PCIClass added in v2.3.0

type PCIClass struct{}

PCIClass is a decoder that transforms PCI class id into a name

func (*PCIClass) Decode added in v2.3.0

func (d *PCIClass) Decode(in []byte, _ config.Decoder) ([]byte, error)

Decode transforms PCI class id into a name

type PCIDevice added in v2.3.0

type PCIDevice struct{}

PCIDevice is a decoder that transforms PCI device id into a name

func (*PCIDevice) Decode added in v2.3.0

func (d *PCIDevice) Decode(in []byte, _ config.Decoder) ([]byte, error)

Decode transforms PCI device id into a name

type PCISubClass added in v2.3.0

type PCISubClass struct{}

PCISubClass is a decoder that transforms PCI class id into a name

func (*PCISubClass) Decode added in v2.3.0

func (d *PCISubClass) Decode(in []byte, _ config.Decoder) ([]byte, error)

Decode transforms PCI class id into a name

type PCIVendor added in v2.3.0

type PCIVendor struct{}

PCIVendor is a decoder that transforms PCI vendor id into a name

func (*PCIVendor) Decode added in v2.3.0

func (d *PCIVendor) Decode(in []byte, _ config.Decoder) ([]byte, error)

Decode transforms PCI vendor id into a name

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, error)

NewSet creates a Set with all known decoders

func (*Set) DecodeLabelsForMetrics added in v2.4.1

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

DecodeLabelsForMetrics transforms eBPF map key bytes into a list of label values according to configuration (different label sets require different names). This decoder method variant does caching and is suitable for metrics.

func (*Set) DecodeLabelsForTracing added in v2.4.1

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

DecodeLabelsForTracing transforms eBPF map key bytes into a list of label values according to configuration (different label sets require different names). This decoder method variant does not do caching and is suitable for tracing.

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 decoder that decodes strings coming from the kernel

func (*String) Decode

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

Decode transforms byte slice from the kernel into string

type Syscall added in v2.2.0

type Syscall struct{}

Syscall is a decoder that decodes syscall numbers into their names

func (*Syscall) Decode added in v2.2.0

func (s *Syscall) Decode(in []byte, _ config.Decoder) ([]byte, error)

Decode transforms a syscall number into a syscall name

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, _ 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