otel

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package otel handles translating DHCP headers and options to otel key/value attributes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllEncoders

func AllEncoders() []func(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

AllEncoders returns a slice of all available DHCP otel encoders.

func EncodeCHADDR

func EncodeCHADDR(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeCHADDR takes the CHADDR header from a DHCP packet and returns an OTEL key/value pair. See https://datatracker.ietf.org/doc/html/rfc2131#page-9

func EncodeFILE

func EncodeFILE(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeFILE takes the file header from a DHCP packet and returns an OTEL key/value pair. See https://datatracker.ietf.org/doc/html/rfc2131#page-9

func EncodeFlags

func EncodeFlags(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeFlags takes DHCP flags from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt1

func EncodeOpt1(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt1 takes DHCP Opt 1 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt119

func EncodeOpt119(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt119 takes DHCP Opt 119 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt12

func EncodeOpt12(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt12 takes DHCP Opt 12 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt15

func EncodeOpt15(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt15 takes DHCP Opt 15 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt28

func EncodeOpt28(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt28 takes DHCP Opt 28 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt3

func EncodeOpt3(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt3 takes DHCP Opt 3 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt42

func EncodeOpt42(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt42 takes DHCP Opt 42 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt51

func EncodeOpt51(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt51 takes DHCP Opt 51 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt53

func EncodeOpt53(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt53 takes DHCP Opt 53 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt54

func EncodeOpt54(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt54 takes DHCP Opt 54 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt6

func EncodeOpt6(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt6 takes DHCP Opt 6 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt60

func EncodeOpt60(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt60 takes DHCP Opt 60 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt93

func EncodeOpt93(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt93 takes DHCP Opt 93 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt94

func EncodeOpt94(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt94 takes DHCP Opt 94 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeOpt97

func EncodeOpt97(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeOpt97 takes DHCP Opt 97 from a DHCP packet and returns an OTEL key/value pair. See https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

func EncodeSIADDR

func EncodeSIADDR(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeSIADDR takes the siaddr header from a DHCP packet and returns an OTEL key/value pair. See https://datatracker.ietf.org/doc/html/rfc2131#page-9

func EncodeYIADDR

func EncodeYIADDR(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)

EncodeYIADDR takes the yiaddr header from a DHCP packet and returns an OTEL key/value pair. See https://datatracker.ietf.org/doc/html/rfc2131#page-9

func OptNotFound

func OptNotFound(err error) bool

OptNotFound returns true if err is an option not found error.

func TraceparentFromContext

func TraceparentFromContext(ctx context.Context) []byte

TraceparentFromContext extracts the binary trace id, span id, and trace flags from the running span in ctx and returns a 26 byte []byte with the traceparent encoded and ready to pass into a suboption (most likely 69) of opt43.

Types

type Encoder

type Encoder struct {
	Log logr.Logger
}

Encoder holds the otel key/value attributes.

func (*Encoder) Encode

func (e *Encoder) Encode(pkt *dhcpv4.DHCPv4, namespace string, encoders ...func(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)) []attribute.KeyValue

Encode runs a slice of encoders against a DHCPv4 packet turning the values into opentelemetry attribute key/value pairs.

Jump to

Keyboard shortcuts

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