prometheus

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Collects and serves statistics about flows. Configuration options for this segments are: The endoint field can be configured: <host>:8080/flowdata <host>:8080/metrics The labels to be exported can be set in the configuration. Default labels are:

router,ipversion,application,protoname,direction,peer,remoteas,remotecountry

Additional Labels are:

src_port,dst_port,src_ip,dst_ip

The additional label should be used with care, because of infite quantity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter struct {
	MetaReg *prometheus.Registry
	FlowReg *prometheus.Registry
	// contains filtered or unexported fields
}

Exporter provides export features to Prometheus

func (*Exporter) Increment

func (e *Exporter) Increment(bytes uint64, packets uint64, labelset prometheus.Labels)

func (*Exporter) IncrementCtrl

func (e *Exporter) IncrementCtrl(topic string, partition int32, offset int64)

func (*Exporter) Initialize

func (e *Exporter) Initialize(labels []string)

Initialize Prometheus Exporter

func (*Exporter) ServeEndpoints

func (e *Exporter) ServeEndpoints(segment *Prometheus)

listen on given endpoint addr with Handler for metricPath and flowdataPath

type Prometheus

type Prometheus struct {
	segments.BaseSegment
	Endpoint     string   // optional, default value is ":8080"
	MetricsPath  string   // optional, default is "/metrics"
	FlowdataPath string   // optional, default is "/flowdata"
	Labels       []string // optional, list of labels to be exported
}

func (Prometheus) New

func (segment Prometheus) New(config map[string]string) segments.Segment

func (*Prometheus) Run

func (segment *Prometheus) Run(wg *sync.WaitGroup)

Jump to

Keyboard shortcuts

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