metrics

package
v0.0.0-...-ff4b512 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FailedImports = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "portmantool_imports_failed_total",
		Help: "Total number of failed imports",
	})

	LastImport = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "portmantool_imports_last",
		Help: "Timestamp of last successful import",
	})

	Ports = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "portmantool_ports",
			Help: "Number of unique host/protocol/port combinations in database (labels: host, protocol, state)",
		},
		[]string{"host", "protocol", "state"},
	)

	RoguePorts = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "portmantool_ports_rogue",
			Help: "Number of ports with a state different from the expected (labels: host, protocol)",
		},
		[]string{"host", "protocol"},
	)
)

Functions

func GetCounterValue

func GetCounterValue(counter prometheus.Counter) (float64, error)

func GetGaugeValue

func GetGaugeValue(gauge prometheus.Gauge) (float64, error)

func InitFromDatabase

func InitFromDatabase(db *gorm.DB) error

func PersistToDatabase

func PersistToDatabase(db *gorm.DB, name string, metric prometheus.Metric) (err error)

func RegisterMetrics

func RegisterMetrics() error

func UpdateFromDatabase

func UpdateFromDatabase(db *gorm.DB) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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