Documentation
¶
Overview ¶
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- func DNSQuestionType(val uint16) attribute.KeyValue
- func DNSResponseCode(val int) attribute.KeyValue
- func NewHandler(operation string, base Handler, opts ...Option) dns.Handler
- func SetEDNS0_TRACE(m *dns.Msg, traceOpt *EDNS0_TRACE)
- func SetRequestAttributes(span trace.Span, m *dns.Msg, serverAddr string, clientAddr string)
- func SetResponseAttributes(span trace.Span, r *dns.Msg, rtt time.Duration, err error)
- func SplitHostPort(addr string) (host string, port int, err error)
- type Client
- type DNSMsgCarrier
- type EDNS0_TRACE
- type Filter
- type Handler
- type Option
- func SetRequestFuncs(fns ...RequestFunc) Option
- func SetResponseFuncs(fns ...ResponseFunc) Option
- func SetSpanStartOpts(opts ...trace.SpanStartOption) Option
- func WithFilters(filters ...Filter) Option
- func WithPropagator(propagator propagation.TextMapPropagator) Option
- func WithRequestFuncs(f ...RequestFunc) Option
- func WithResponseFuncs(f ...ResponseFunc) Option
- func WithTracer(tracer trace.Tracer) Option
- type RequestFunc
- type ResponseFunc
- type SpanID
- type TraceID
Constants ¶
const (
EDNS0TRACE = 0xFDE9
)
Variables ¶
This section is empty.
Functions ¶
func DNSQuestionType ¶ added in v0.2.0
func DNSResponseCode ¶ added in v0.2.0
func SetEDNS0_TRACE ¶
func SetEDNS0_TRACE(m *dns.Msg, traceOpt *EDNS0_TRACE)
func SetRequestAttributes ¶ added in v0.2.0
func SetResponseAttributes ¶ added in v0.2.0
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ExchangeContext ¶
type DNSMsgCarrier ¶
type DNSMsgCarrier struct {
// contains filtered or unexported fields
}
func NewDNSMsgCarrier ¶
func NewDNSMsgCarrier(m *dns.Msg) *DNSMsgCarrier
func (*DNSMsgCarrier) Get ¶
func (c *DNSMsgCarrier) Get(key string) string
func (*DNSMsgCarrier) Keys ¶
func (c *DNSMsgCarrier) Keys() []string
func (*DNSMsgCarrier) Set ¶
func (c *DNSMsgCarrier) Set(key string, value string)
type EDNS0_TRACE ¶
type EDNS0_TRACE struct {
Version byte `json:"version"`
TraceID TraceID `json:"trace_id"`
SpanID SpanID `json:"span_id"`
TraceFlags byte `json:"trace_flags"`
Tracestate []byte `json:"tracestate"`
}
func GetEDNS0_TRACE ¶
func GetEDNS0_TRACE(m *dns.Msg) *EDNS0_TRACE
func (*EDNS0_TRACE) Option ¶
func (e *EDNS0_TRACE) Option() uint16
func (*EDNS0_TRACE) Traceparent ¶
func (e *EDNS0_TRACE) Traceparent() string
type Filter ¶ added in v0.2.0
Filter returns true when the message should be skipped from tracing and trace context propagation.
type Option ¶
type Option func(*config)
func SetRequestFuncs ¶ added in v0.2.0
func SetRequestFuncs(fns ...RequestFunc) Option
SetRequestFuncs Withs the functions to use for updating the span using the request message before processing is completed.
func SetResponseFuncs ¶ added in v0.2.0
func SetResponseFuncs(fns ...ResponseFunc) Option
SetResponseFuncs Withs the functions to use for updating the span using the response message after processing is completed.
func SetSpanStartOpts ¶ added in v0.2.0
func SetSpanStartOpts(opts ...trace.SpanStartOption) Option
SetSpanStartOpts sets the options to use when starting a span.
func WithFilters ¶ added in v0.2.0
WithFilters appends filters used to skip tracing and trace context propagation for matched messages (filter returns true).
func WithPropagator ¶ added in v0.2.0
func WithPropagator(propagator propagation.TextMapPropagator) Option
WithPropagator sets the propagator to use for extracting and injecting trace context from/to DNS messages.
func WithRequestFuncs ¶ added in v0.2.0
func WithRequestFuncs(f ...RequestFunc) Option
WithRequestFuncs Withs functions to use for updating the span using the request message before processing is completed.
func WithResponseFuncs ¶ added in v0.2.0
func WithResponseFuncs(f ...ResponseFunc) Option
WithResponseFuncs Withs functions to use for updating the span using the response message after processing is completed.
func WithTracer ¶
WithTracer sets the tracer to use for spans created by the handler.