udp_listener

package
v1.29.5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 9 Imported by: 0

README

UDP Listener Input Plugin

DEPRECATED: As of version 1.3 the UDP listener plugin has been deprecated in favor of the socket_listener plugin

Service Input

This plugin is a service input. Normal plugins gather metrics determined by the interval setting. Service plugins start a service to listens and waits for metrics or events to occur. Service plugins have two key differences from normal plugins:

  1. The global or plugin specific interval setting may not apply
  2. The CLI options of --test, --test-wait, and --once may not produce output for this plugin

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the CONFIGURATION.md for more details.

Configuration

# Generic UDP listener
[[inputs.udp_listener]]
  # see https://github.com/influxdata/telegraf/tree/master/plugins/inputs/socket_listener

Metrics

Example Output

Documentation

Index

Constants

View Source
const UDPMaxPacketSize int = 64 * 1024

UDPMaxPacketSize is packet limit, see https://en.wikipedia.org/wiki/User_Datagram_Protocol#Packet_structure

Variables

This section is empty.

Functions

This section is empty.

Types

type UDPListener added in v1.18.0

type UDPListener struct {
	ServiceAddress string

	// UDPBufferSize should only be set if you want/need the telegraf UDP socket to
	// differ from the system setting. In cases where you set the rmem_default to a lower
	// value at the host level, but need a larger buffer for UDP bursty traffic, this
	// setting enables you to configure that value ONLY for telegraf UDP sockets on this listener
	// Set this to 0 (or comment out) to take system default
	//
	// NOTE: You should ensure that your rmem_max is >= to this setting to work properly!
	// (e.g. sysctl -w net.core.rmem_max=N)
	UDPBufferSize          int `toml:"udp_buffer_size"`
	AllowedPendingMessages int

	// UDPPacketSize is deprecated, it's only here for legacy support
	// we now always create 1 max size buffer and then copy only what we need
	// into the in channel
	// see https://github.com/influxdata/telegraf/pull/992
	UDPPacketSize int `toml:"udp_packet_size"`

	sync.Mutex

	PacketsRecv selfstat.Stat
	BytesRecv   selfstat.Stat

	Log telegraf.Logger
	// contains filtered or unexported fields
}

UDPListener main struct for the collector

func (*UDPListener) Gather added in v1.18.0

func (u *UDPListener) Gather(_ telegraf.Accumulator) error

All the work is done in the Start() function, so this is just a dummy function.

func (*UDPListener) SampleConfig added in v1.18.0

func (*UDPListener) SampleConfig() string

func (*UDPListener) SetParser added in v1.18.0

func (u *UDPListener) SetParser(parser telegraf.Parser)

func (*UDPListener) Start added in v1.18.0

func (u *UDPListener) Start(acc telegraf.Accumulator) error

func (*UDPListener) Stop added in v1.18.0

func (u *UDPListener) Stop()

Jump to

Keyboard shortcuts

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