Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

dnsconv

v1.47.0
go.opentelemetry.io/otel/semconv/v1.33.0/dnsconv

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

11 matches

Top ↑

Package dnsconv provides types and functionality for OpenTelemetry semantic conventions in the "dns" namespace.

Types

ErrorTypeAttr

type ErrorTypeAttr string

ErrorTypeAttr is an attribute conforming to the error.type semantic conventions. It represents the describes the error the DNS lookup failed with.

ErrorTypeOther

var ErrorTypeOther ErrorTypeAttr = "_OTHER"

ErrorTypeOther is a fallback error value to be used when the instrumentation doesn't define a custom value.

LookupDuration

type LookupDuration struct {
	metric.Float64Histogram
}

LookupDuration is an instrument used to record metric values conforming to the "dns.lookup.duration" semantic conventions. It represents the measures the time taken to perform a DNS lookup.

NewLookupDuration

func NewLookupDuration(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (LookupDuration, error)

NewLookupDuration returns a new LookupDuration instrument.

LookupDuration.AttrErrorType

func (LookupDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes the error the DNS lookup failed with.

LookupDuration.Description

func (LookupDuration) Description() string

Description returns the semantic convention description of the instrument

LookupDuration.Inst

func (m LookupDuration) Inst() metric.Float64Histogram

Inst returns the underlying metric instrument.

LookupDuration.Name

func (LookupDuration) Name() string

Name returns the semantic convention name of the instrument.

LookupDuration.Record

func (m LookupDuration) Record(
	ctx context.Context,
	val float64,
	questionName string,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

The questionName is the the name being queried.

All additional attrs passed are included in the recorded value.

LookupDuration.Unit

func (LookupDuration) Unit() string

Unit returns the semantic convention unit of the instrument

Dependency graph