Version: v0.5.12 Latest Latest

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 12 Imported by: 5




This section is empty.


This section is empty.


This section is empty.


type ExporterInput added in v0.4.0

type ExporterInput struct {
	// CollectorAddress needs to be provided in hostIP:port format.
	CollectorAddress string
	// CollectorProtocol needs to be provided in lower case format.
	// We support "tcp" and "udp" protocols.
	CollectorProtocol   string
	ObservationDomainID uint32
	TempRefTimeout      uint32
	IsEncrypted         bool
	CACert              []byte
	ClientCert          []byte
	ClientKey           []byte
	IsIPv6              bool
	SendJSONRecord      bool
	JSONBufferLen       int
	CheckConnInterval   time.Duration

type ExportingProcess

type ExportingProcess struct {
	// contains filtered or unexported fields
  1. Tested one exportingProcess process per exporter. Can support multiple collector scenario by creating different instances of exporting process. Need to be tested
  2. Only one observation point per observation domain is supported, so observation point ID not defined.
  3. Supports only TCP and UDP; one session at a time. SCTP is not supported.
  4. UDP needs to send MTU size packets as per RFC7011. We are not honoring that, and relying on IP fragmentation and assuming data loss in the network is minimal. We will revisit this if there are any issues, and get PathMTU from the user as part of exporter input.

func InitExportingProcess

func InitExportingProcess(input ExporterInput) (*ExportingProcess, error)

InitExportingProcess takes in collector address(net.Addr format), obsID(observation ID) and tempRefTimeout(template refresh timeout). tempRefTimeout is applicable only for collectors listening over UDP; unit is seconds. For TCP, you can pass any value. For UDP, if 0 is passed, consider 1800s as default.

PathMTU is recommended for UDP transport. If not given a valid value, i.e., either 0 or a value more than 1500, we consider a default value of 512B as per RFC7011. PathMTU is optional for TCP as we use max socket buffer size of 65535. It can be provided as 0. JSONBufferLen is recommended for sending json record. If not given a valid value, we consider a default 5000B.

func (*ExportingProcess) CloseConnToCollector

func (ep *ExportingProcess) CloseConnToCollector()

func (*ExportingProcess) GetMsgSizeLimit added in v0.4.2

func (ep *ExportingProcess) GetMsgSizeLimit() int

func (*ExportingProcess) NewTemplateID

func (ep *ExportingProcess) NewTemplateID() uint16

NewTemplateID is called to get ID when creating new template record.

func (*ExportingProcess) SendSet added in v0.4.0

func (ep *ExportingProcess) SendSet(set entities.Set) (int, error)

Source Files

Jump to

Keyboard shortcuts

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