metrics

package
v2.0.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package metrics defines the DNS metrics middleware and a metric interface to give to the middleware constructor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics interface {
	RequestsInc()
	QuestionsInc(class, qType string)
	RcodeInc(rcode string)
	AnswersInc(class, qType string)
	ResponsesInc()
	InFlightRequestsInc()
	InFlightRequestsDec()
}

type Middleware

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

func New

func New(settings Settings) (middleware *Middleware, err error)

func (*Middleware) Stop

func (m *Middleware) Stop() (err error)

func (*Middleware) String

func (m *Middleware) String() string

func (*Middleware) Wrap

func (m *Middleware) Wrap(next dns.Handler) dns.Handler

Wrap wraps the DNS handler with the middleware.

type Settings

type Settings struct {
	// Metrics is the interface to interact with metrics in the
	// DNS middleware. It defaults to a No-Op implementation.
	Metrics Metrics
}

func (*Settings) SetDefaults

func (s *Settings) SetDefaults()

func (Settings) Validate

func (s Settings) Validate() (err error)

Directories

Path Synopsis
Package noop defines a No-Op metric implementation for the metrics middleware.
Package noop defines a No-Op metric implementation for the metrics middleware.
Package prometheus defines a Prometheus metric implementation for a DNS server middleware.
Package prometheus defines a Prometheus metric implementation for a DNS server middleware.

Jump to

Keyboard shortcuts

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