Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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
}
- Tested one exportingProcess process per exporter. Can support multiple collector scenario by creating different instances of exporting process. Need to be tested
- Only one observation point per observation domain is supported, so observation point ID not defined.
- Supports only TCP and UDP; one session at a time. SCTP is not supported.
- 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.