exporter

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExporterName

func GetExporterName() string

GetExporterName returns exporter name.

func GetRevision

func GetRevision() string

GetRevision returns exporter revision.

func GetVersion

func GetVersion() string

GetVersion returns exporter version.

func GetVersionBuildContext

func GetVersionBuildContext() string

GetVersionBuildContext returns exporter build context.

func GetVersionInfo

func GetVersionInfo() string

GetVersionInfo returns exporter info.

func IsConnectionError

func IsConnectionError(err error) bool

IsConnectionError checks whether it is connectivity issue.

Types

type Exporter

type Exporter struct {
	sync.RWMutex

	Node   *RouterNode
	Tokens map[string]bool
	// contains filtered or unexported fields
}

Exporter collects GoBGP data from the given server and exports them using the prometheus metrics package.

func NewExporter

func NewExporter(opts Options) (*Exporter, error)

NewExporter returns an initialized Exporter.

func (*Exporter) AddAuthenticationToken

func (e *Exporter) AddAuthenticationToken(s string) error

AddAuthenticationToken adds an authentication token for accessing the exporter itself.

func (*Exporter) GetPollInterval

func (e *Exporter) GetPollInterval() int64

GetPollInterval returns exporters minimal polling/scraping interval.

func (*Exporter) Scrape

func (e *Exporter) Scrape(w http.ResponseWriter, r *http.Request)

Scrape scrapes individual nodes.

func (*Exporter) SetPollInterval

func (e *Exporter) SetPollInterval(i int64)

SetPollInterval sets exporter's minimal polling/scraping interval.

func (*Exporter) Summary

func (e *Exporter) Summary(p string, w http.ResponseWriter, r *http.Request)

Summary returns the content of the Exporter's default page.

type Options

type Options struct {
	Address string
	TLS     *tls.Config
	Timeout int
	Logger  log.Logger
}

Options are the options for the initialization of an instance of the Exporter.

type RouterNode

type RouterNode struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

RouterNode is an instance of a GoBGP router.

func NewRouterNode

func NewRouterNode(addr string, timeout int, tlsConfig *tls.Config, logger log.Logger) (*RouterNode, error)

NewRouterNode creates an instance of RouterNode.

func (*RouterNode) Collect

func (n *RouterNode) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*RouterNode) Describe

func (n *RouterNode) Describe(ch chan<- *prometheus.Desc)

Describe describes all the metrics ever exported by the exporter. It implements prometheus.Collector.

func (*RouterNode) GatherMetrics

func (n *RouterNode) GatherMetrics()

GatherMetrics collect data from a GoBGP router and stores them as Prometheus metrics.

func (*RouterNode) GetMetricsTable

func (n *RouterNode) GetMetricsTable() string

GetMetricsTable returns markdown-formatted table with the name, help, and labels of the metrics produced by the exporter.

func (*RouterNode) GetPeers

func (n *RouterNode) GetPeers()

GetPeers collects information about BGP peers.

func (*RouterNode) GetRibCounters

func (n *RouterNode) GetRibCounters()

GetRibCounters collects BGP routing information base (RIB) related metrics.

func (*RouterNode) IncrementErrorCounter

func (n *RouterNode) IncrementErrorCounter()

IncrementErrorCounter increases the counter of failed queries to a network node.

Jump to

Keyboard shortcuts

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