Documentation ¶
Index ¶
- Constants
- Variables
- func NewDefaultPromTemplateSystem(key string) netflow.NetFlowTemplateSystem
- func NewPromTemplateSystem(key string, wrapped netflow.NetFlowTemplateSystem) netflow.NetFlowTemplateSystem
- func PromDecoderWrapper(wrapped utils.DecoderFunc, name string) utils.DecoderFunc
- func WrapPromProducer(wrapped producer.ProducerInterface) producer.ProducerInterface
- type PromProducerWrapper
- type PromTemplateSystem
- func (s *PromTemplateSystem) AddTemplate(version uint16, obsDomainId uint32, templateId uint16, template interface{}) error
- func (s *PromTemplateSystem) GetTemplate(version uint16, obsDomainId uint32, templateId uint16) (interface{}, error)
- func (s *PromTemplateSystem) RemoveTemplate(version uint16, obsDomainId uint32, templateId uint16) (interface{}, error)
- type ReceiverMetric
Constants ¶
View Source
const (
NAMESPACE = "goflow2"
)
Variables ¶
View Source
var ( MetricReceivedDroppedPackets = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_dropped_packets_total", Help: "Packets dropped before processing.", Namespace: NAMESPACE, }, []string{"remote_ip", "local_ip", "local_port"}, ) MetricReceivedDroppedBytes = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_dropped_bytes_total", Help: "Bytes dropped before processing.", Namespace: NAMESPACE, }, []string{"remote_ip", "local_ip", "local_port"}, ) MetricTrafficBytes = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_traffic_bytes_total", Help: "Bytes received by the application.", Namespace: NAMESPACE, }, []string{"remote_ip", "local_ip", "local_port", "type"}, ) MetricTrafficPackets = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_traffic_packets_total", Help: "Packets received by the application.", Namespace: NAMESPACE}, []string{"remote_ip", "local_ip", "local_port", "type"}, ) MetricPacketSizeSum = prometheus.NewSummaryVec( prometheus.SummaryOpts{ Name: "flow_traffic_size_bytes", Help: "Summary of packet size.", Namespace: NAMESPACE, Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }, []string{"remote_ip", "local_ip", "local_port", "type"}, ) DecoderErrors = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_decoder_error_total", Help: "NetFlow/sFlow processed errors.", Namespace: NAMESPACE}, []string{"router", "name"}, ) DecoderTime = prometheus.NewSummaryVec( prometheus.SummaryOpts{ Name: "flow_decoding_time_seconds", Help: "Decoding time summary.", Namespace: NAMESPACE, Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }, []string{"name"}, ) NetFlowStats = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_process_nf_total", Help: "NetFlows processed.", Namespace: NAMESPACE}, []string{"router", "version"}, ) NetFlowErrors = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_process_nf_errors_total", Help: "NetFlows processed errors.", Namespace: NAMESPACE}, []string{"router", "error"}, ) NetFlowSetRecordsStatsSum = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_process_nf_flowset_records_total", Help: "NetFlows FlowSets sum of records.", Namespace: NAMESPACE}, []string{"router", "version", "type"}, ) NetFlowSetStatsSum = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_process_nf_flowset_total", Help: "NetFlows FlowSets sum.", Namespace: NAMESPACE}, []string{"router", "version", "type"}, ) NetFlowTimeStatsSum = prometheus.NewSummaryVec( prometheus.SummaryOpts{ Name: "flow_process_nf_delay_seconds", Help: "NetFlows time difference between time of flow and processing.", Namespace: NAMESPACE, Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }, []string{"router", "version"}, ) NetFlowTemplatesStats = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_process_nf_templates_total", Help: "NetFlows Template count.", Namespace: NAMESPACE}, []string{"router", "version", "obs_domain_id", "template_id", "type"}, ) SFlowStats = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_process_sf_total", Help: "sFlows processed.", Namespace: NAMESPACE}, []string{"router", "agent", "version"}, ) SFlowSampleStatsSum = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_process_sf_samples_total", Help: "SFlows samples sum.", Namespace: NAMESPACE}, []string{"router", "agent", "version", "type"}, ) SFlowSampleRecordsStatsSum = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "flow_process_sf_samples_records_total", Help: "SFlows samples sum of records.", Namespace: NAMESPACE}, []string{"router", "agent", "version", "type"}, ) )
Functions ¶
func NewDefaultPromTemplateSystem ¶
func NewDefaultPromTemplateSystem(key string) netflow.NetFlowTemplateSystem
A default Prometheus template generator function to be used by a pipe
func NewPromTemplateSystem ¶
func NewPromTemplateSystem(key string, wrapped netflow.NetFlowTemplateSystem) netflow.NetFlowTemplateSystem
Creates a Prometheus template system that wraps another template system. The key argument is providing the router information for metrics.
func PromDecoderWrapper ¶
func PromDecoderWrapper(wrapped utils.DecoderFunc, name string) utils.DecoderFunc
func WrapPromProducer ¶
func WrapPromProducer(wrapped producer.ProducerInterface) producer.ProducerInterface
Wraps a producer with metrics
Types ¶
type PromProducerWrapper ¶
type PromProducerWrapper struct {
// contains filtered or unexported fields
}
func (*PromProducerWrapper) Close ¶
func (p *PromProducerWrapper) Close()
func (*PromProducerWrapper) Commit ¶
func (p *PromProducerWrapper) Commit(flowMessageSet []producer.ProducerMessage)
func (*PromProducerWrapper) Produce ¶
func (p *PromProducerWrapper) Produce(msg interface{}, args *producer.ProduceArgs) ([]producer.ProducerMessage, error)
type PromTemplateSystem ¶
type PromTemplateSystem struct {
// contains filtered or unexported fields
}
func (*PromTemplateSystem) AddTemplate ¶
func (s *PromTemplateSystem) AddTemplate(version uint16, obsDomainId uint32, templateId uint16, template interface{}) error
func (*PromTemplateSystem) GetTemplate ¶
func (s *PromTemplateSystem) GetTemplate(version uint16, obsDomainId uint32, templateId uint16) (interface{}, error)
func (*PromTemplateSystem) RemoveTemplate ¶ added in v2.1.0
func (s *PromTemplateSystem) RemoveTemplate(version uint16, obsDomainId uint32, templateId uint16) (interface{}, error)
type ReceiverMetric ¶ added in v2.1.1
type ReceiverMetric struct { }
func NewReceiverMetric ¶ added in v2.1.1
func NewReceiverMetric() *ReceiverMetric
func (*ReceiverMetric) Dropped ¶ added in v2.1.1
func (r *ReceiverMetric) Dropped(pkt utils.Message)
Click to show internal directories.
Click to hide internal directories.