Documentation ¶
Overview ¶
Package otel handles translating DHCP headers and options to otel key/value attributes.
Index ¶
- func AllEncoders() []func(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeCHADDR(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeFILE(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeFlags(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt1(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt119(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt12(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt15(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt28(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt3(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt42(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt51(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt53(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt54(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt6(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt60(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt93(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt94(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeOpt97(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeSIADDR(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func EncodeYIADDR(d *dhcpv4.DHCPv4, namespace string) (attribute.KeyValue, error)
- func OptNotFound(err error) bool
- func TraceparentFromContext(ctx context.Context) []byte
- type Encoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllEncoders ¶
AllEncoders returns a slice of all available DHCP otel encoders.
func EncodeCHADDR ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
OptNotFound returns true if err is an option not found error.
func TraceparentFromContext ¶
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 ¶
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.