collector

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ArpTableSubsystem = "arp_table"
View Source
const CronTableSubsystem = "cron"
View Source
const GatewaysSubsystem = "gateways"
View Source
const InterfacesSubsystem = "interfaces"
View Source
const OpenVPNSubsystem = "openvpn"
View Source
const ProtocolSubsystem = "protocol"
View Source
const ServicesSubsystem = "services"
View Source
const UnboundDNSSubsystem = "unbound_dns"
View Source
const WireguardSubsystem = "wireguard"

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	Client *opnsense.Client
	// contains filtered or unexported fields
}

func New

func New(client *opnsense.Client, log log.Logger, instanceName string, options ...Option) (*Collector, error)

New creates a new Collector instance.

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (*Collector) Describe

func (c *Collector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

type CollectorInstance

type CollectorInstance interface {
	Register(namespace, isntance string, log log.Logger)
	Name() string
	Describe(ch chan<- *prometheus.Desc)
	Update(client *opnsense.Client, ch chan<- prometheus.Metric) *opnsense.APICallError
}

CollectorInstance is the interface a service specific collectors must implement.

type Option

type Option func(*Collector) error

func WithoutArpTableCollector

func WithoutArpTableCollector() Option

WithoutArpTableCollector Option removes the arp_table collector from the list of collectors

func WithoutCronCollector

func WithoutCronCollector() Option

WithoutCronCollector Option removes the cron collector from the list of collectors

func WithoutUnboundCollector

func WithoutUnboundCollector() Option

WithoutUnboundCollector Option removes the unbound_dns collector from the list of collectors

func WithoutWireguardCollector

func WithoutWireguardCollector() Option

WithoutWireguardCollector Option removes the wireguard collector from the list of collectors

type WireguardCollector

type WireguardCollector struct {
	TransferRx      *prometheus.Desc
	TransferTx      *prometheus.Desc
	LatestHandshake *prometheus.Desc
	// contains filtered or unexported fields
}

func (*WireguardCollector) Describe

func (c *WireguardCollector) Describe(ch chan<- *prometheus.Desc)

func (*WireguardCollector) Name

func (c *WireguardCollector) Name() string

func (*WireguardCollector) Register

func (c *WireguardCollector) Register(namespace, instanceLabel string, log log.Logger)

func (*WireguardCollector) Update

func (c *WireguardCollector) Update(client *opnsense.Client, ch chan<- prometheus.Metric) *opnsense.APICallError

Jump to

Keyboard shortcuts

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