Documentation
¶
Overview ¶
Package goflowlib provides converters between the goflow library and the types used internally for netflow at Datadog.
Index ¶
- func ConvertFlow(srcFlow *flowpb.FlowMessage, namespace string) *common.Flow
- func ConvertFlowWithAdditionalFields(srcFlow *common.FlowMessageWithAdditionalFields, namespace string) *common.Flow
- func ConvertMetric(metric *promClient.Metric, metricFamily *promClient.MetricFamily) (metrics.MetricType, string, float64, []string, error)
- type AggregatorFormatDriver
- type FlowRunnableState
- type FlowStateWrapper
- type GoflowLoggerAdapter
- func (g *GoflowLoggerAdapter) Error(params ...interface{})
- func (g *GoflowLoggerAdapter) Errorf(format string, params ...interface{})
- func (g *GoflowLoggerAdapter) Fatalf(format string, params ...interface{})
- func (g *GoflowLoggerAdapter) Printf(format string, params ...interface{})
- func (g *GoflowLoggerAdapter) Warn(params ...interface{})
- func (g *GoflowLoggerAdapter) Warnf(format string, params ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertFlow ¶
func ConvertFlow(srcFlow *flowpb.FlowMessage, namespace string) *common.Flow
ConvertFlow convert goflow flow structure to internal flow structure
func ConvertFlowWithAdditionalFields ¶
func ConvertFlowWithAdditionalFields(srcFlow *common.FlowMessageWithAdditionalFields, namespace string) *common.Flow
ConvertFlowWithAdditionalFields convert goflow flow structure and additional fields to internal flow structure
func ConvertMetric ¶
func ConvertMetric(metric *promClient.Metric, metricFamily *promClient.MetricFamily) ( metrics.MetricType, string, float64, []string, error, )
ConvertMetric converts prometheus metric to datadog compatible metrics
Types ¶
type AggregatorFormatDriver ¶
type AggregatorFormatDriver struct {
// contains filtered or unexported fields
}
AggregatorFormatDriver is used as goflow formatter to forward flow data to aggregator/EP Forwarder
func NewAggregatorFormatDriver ¶
func NewAggregatorFormatDriver(flowAgg chan *common.Flow, namespace string, listenerFlowCount *atomic.Int64) *AggregatorFormatDriver
NewAggregatorFormatDriver returns a new AggregatorFormatDriver
func (*AggregatorFormatDriver) Format ¶
func (d *AggregatorFormatDriver) Format(data interface{}) ([]byte, []byte, error)
Format desc
func (*AggregatorFormatDriver) Init ¶
func (d *AggregatorFormatDriver) Init(context.Context) error
Init desc
func (*AggregatorFormatDriver) Prepare ¶
func (d *AggregatorFormatDriver) Prepare() error
Prepare desc
type FlowRunnableState ¶
type FlowRunnableState interface { // FlowRoutine starts flow processing workers FlowRoutine(workers int, addr string, port int, reuseport bool) error // Shutdown trigger shutdown of the flow processing workers Shutdown() }
FlowRunnableState provides common interface for StateNetFlow/StateSFlow/StateNFLegacy/etc
type FlowStateWrapper ¶
type FlowStateWrapper struct { State FlowRunnableState Hostname string Port uint16 }
FlowStateWrapper is a wrapper for StateNetFlow/StateSFlow/StateNFLegacy to provide additional info like hostname/port
func StartFlowRoutine ¶
func StartFlowRoutine( flowType common.FlowType, hostname string, port uint16, workers int, namespace string, fieldMappings []config.Mapping, flowInChan chan *common.Flow, logger log.Component, atomicErr *atomic.String, listenerFlowCount *atomic.Int64) (*FlowStateWrapper, error)
StartFlowRoutine starts one of the goflow flow routine depending on the flow type
func (*FlowStateWrapper) Shutdown ¶
func (s *FlowStateWrapper) Shutdown()
Shutdown is a wrapper for StateNetFlow/StateSFlow/StateNFLegacy Shutdown method
type GoflowLoggerAdapter ¶
type GoflowLoggerAdapter struct {
log.Component
}
GoflowLoggerAdapter is used to implement goflow's logging interface from our logger https://github.com/netsampler/goflow2/blob/v1/utils/utils.go#L41-L51
func (*GoflowLoggerAdapter) Error ¶
func (g *GoflowLoggerAdapter) Error(params ...interface{})
Error logs the given arguments, separated by spaces, at the error level
func (*GoflowLoggerAdapter) Errorf ¶
func (g *GoflowLoggerAdapter) Errorf(format string, params ...interface{})
Errorf logs the given formatted arguments at the error level
func (*GoflowLoggerAdapter) Fatalf ¶
func (g *GoflowLoggerAdapter) Fatalf(format string, params ...interface{})
Fatalf logs the given formatted arguments at the critical level
func (*GoflowLoggerAdapter) Printf ¶
func (g *GoflowLoggerAdapter) Printf(format string, params ...interface{})
Printf logs the given formatted arguments at the info level
func (*GoflowLoggerAdapter) Warn ¶
func (g *GoflowLoggerAdapter) Warn(params ...interface{})
Warn logs the given arguments, separated by spaces, at the warn level
func (*GoflowLoggerAdapter) Warnf ¶
func (g *GoflowLoggerAdapter) Warnf(format string, params ...interface{})
Warnf logs the given formatted arguments at the warn level
Directories
¶
Path | Synopsis |
---|---|
Package additionalfields provides a producer collecting additional fields from Netflow/IPFIX packets.
|
Package additionalfields provides a producer collecting additional fields from Netflow/IPFIX packets. |
Package netflowstate provides a Netflow state manager on top of goflow default producer, to allow additional fields collection.
|
Package netflowstate provides a Netflow state manager on top of goflow default producer, to allow additional fields collection. |