exporter

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIPFIXMsg added in v0.8.0

func CreateIPFIXMsg(set entities.Set, obsDomainID uint32, seqNumber uint32, exportTime time.Time) ([]byte, error)

Types

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
	// TLSClientConfig is set to use an encrypted connection to the collector.
	TLSClientConfig   *ExporterTLSClientConfig
	IsIPv6            bool
	SendJSONRecord    bool
	JSONBufferLen     int
	CheckConnInterval time.Duration
}

type ExporterTLSClientConfig added in v0.5.14

type ExporterTLSClientConfig struct {
	// ServerName is passed to the server for SNI and is used in the client to check server
	// certificates against. If ServerName is empty, the hostname used to contact the
	// server is used.
	ServerName string
	// CAData holds PEM-encoded bytes for trusted root certificates for server.
	CAData []byte
	// CertData holds PEM-encoded bytes.
	CertData []byte
	// KeyData holds PEM-encoded bytes.
	KeyData []byte
}

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)

Jump to

Keyboard shortcuts

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