resolverstats

package
v0.0.0-...-46281ef Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: EUPL-1.2 Imports: 13 Imported by: 0

README

resolverstats

Name

resolverstats - collect statistics about upstream DNS servers in Redis.

Description

The resolverstats plugin measures the response times of upstream DNS servers in Redis. It works only in combination with the forward and metadata plugins.

A logged event is a comma separated list of:

  • Unix timestamp in floating point format,
  • IP address of the upstream server,
  • State of the transaction (see below),
  • Duration of the transaction in seconds as a floating point number.

The state can be one of:

  • valid
  • timeout
  • error

The state invalid is currently not supported.

Note that errors and timeouts are hidden if at least one of the configured upstream DNS servers is working. The forward plugin detects and avoids non-responsive servers automatically.

The last 25000 events are stored under the Redis key:

dns_stats:NAME

Where NAME is configured per server block.

Syntax

resolverstats NAME

The NAME is part of the key that is used to store the events in Redis.

Examples

Collect stats from the configured upstream servers under Redis key dns_stats:custom:

. {
    resolverstats custom
    forward . 1.1.1.1:53 9.9.9.9:53
    metadata
}

Metadata

The metadata and forward plugins must also be enabled.

The plugin will read the following metadata:

  • forward/upstream: IP and port of the upstream server

See also

The relevant classes in the ICAP server are:

Documentation

Overview

* Copyright 2024 eBlocker Open Source UG (haftungsbeschraenkt) * * Licensed under the EUPL, Version 1.2 or - as soon they will be * approved by the European Commission - subsequent versions of the EUPL * (the "License"); You may not use this work except in compliance with * the License. You may obtain a copy of the License at: * * https://joinup.ec.europa.eu/page/eupl-text-11-12 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing * permissions and limitations under the License.

* Copyright 2024 eBlocker Open Source UG (haftungsbeschraenkt) * * Licensed under the EUPL, Version 1.2 or - as soon they will be * approved by the European Commission - subsequent versions of the EUPL * (the "License"); You may not use this work except in compliance with * the License. You may obtain a copy of the License at: * * https://joinup.ec.europa.eu/page/eupl-text-11-12 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing * permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackgroundLogger

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

BackgroundCounter has a channel to send events to. It uses a Database to store events. Closing the stopChannel stops the background process.

type Database

type Database interface {
	// contains filtered or unexported methods
}

Database receives events in a slice. The events are to be stored in a Redis list under the given key.

type EventLogger

type EventLogger interface {
	// contains filtered or unexported methods
}

EventLogger logs resolver events.

type RedisDatabase

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

RedisDatabase connects to Redis.

type ResolverStats

type ResolverStats struct {
	Next plugin.Handler
	// contains filtered or unexported fields
}

ResolverStats represents the plugin's configuration

func NewResolverStats

func NewResolverStats(next plugin.Handler, resolverName string) *ResolverStats

Newresolverstats creates a resolverstats logging to the Redis database.

func (*ResolverStats) Name

func (stats *ResolverStats) Name() string

Name implements plugin.Handler.

func (*ResolverStats) ServeDNS

func (stats *ResolverStats) ServeDNS(ctx context.Context, writer dns.ResponseWriter, req *dns.Msg) (int, error)

ServeDNS implements plugin.Handler.

Jump to

Keyboard shortcuts

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