metrics

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package metrics is the central storage lcoation for all program metrics.

Index

Constants

This section is empty.

Variables

View Source
var (
	MissedPackets = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "pcap_missed_packets_total",
			Help: "How many packets were captured and thrown away.  This should always be zero.",
		},
		[]string{"saverstate"},
	)
	MissedUUIDs = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "pcap_missed_uuids_total",
			Help: "How many uuid notifications were ignored.  This should always be zero.",
		},
		[]string{"saverstate"},
	)

	// Savers are internal data structures each with a single associated
	// goroutine, that are allocated and run once for each connection. The start
	// and stop of that goroutine is counted in SaversStarted and SaversStopped,
	// their errors in SaverErrors, and the current state of all running Savers
	// is in SaverCount.
	SaversStarted = promauto.NewCounter(
		prometheus.CounterOpts{
			Name: "pcap_saver_starts_total",
			Help: "How many flows have started to be saved.",
		},
	)
	SaversStopped = promauto.NewCounter(
		prometheus.CounterOpts{
			Name: "pcap_saver_stops_total",
			Help: "How many flows have been terminated and saved.",
		},
	)
	SaverErrors = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "pcap_saver_errors_total",
			Help: "How many flows have not been saved by a saver due to errors",
		},
		[]string{"reason"},
	)
	SaverCount = promauto.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "pcap_saver_states",
			Help: "How many savers are currently in each state",
		},
		[]string{"state"},
	)
	SaversSkipped = promauto.NewCounter(
		prometheus.CounterOpts{
			Name: "pcap_saver_skipped_total",
			Help: "How many flows were never saved due to configured memory limits.",
		},
	)

	// Demuxer metrics keep track of the state of the system that sends packets
	// to a particular saver.
	DemuxerBadPacket = promauto.NewCounter(
		prometheus.CounterOpts{
			Name: "pcap_demuxer_bad_packets_total",
			Help: "How many packets has the demuxer received that it could not process.  This should always be zero.",
		},
	)
	DemuxerGCLatency = promauto.NewHistogram(
		prometheus.HistogramOpts{
			Name:    "pcap_demuxer_gc_latency_seconds",
			Help:    "How long has each GC call taken, and how many GC calls have there been.",
			Buckets: prometheus.ExponentialBuckets(.000001, 2, 20),
		},
	)
	DemuxerUUIDCount = promauto.NewCounter(
		prometheus.CounterOpts{
			Name: "pcap_demuxer_uuids_total",
			Help: "How many UUIDs has the demuxer been told about. Should match pcap_saver_starts_total very closely",
		},
	)
	DemuxerGarbageCollected = promauto.NewCounter(
		prometheus.CounterOpts{
			Name: "pcap_demuxer_savers_garbage_collected_total",
			Help: "How many savers have been garbage collected.",
		},
	)
	DemuxerSaverCount = promauto.NewGauge(
		prometheus.GaugeOpts{
			Name: "pcap_demuxer_savers_active",
			Help: "How many savers were still active after the most recent garbage collection round",
		},
	)

	BadEventsFromTCPInfo = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "pcap_tcpinfohandler_bad_events_total",
			Help: "How many unparseable events have been sent from tcp-info. This should always be zero.",
		},
		[]string{"reason"},
	)

	InterfacesBeingCaptured = promauto.NewGauge(
		prometheus.GaugeOpts{
			Name: "pcap_muxer_interfaces_with_captures",
			Help: "How many interfaces currently have a packet capture running on them, according to the muxer.",
		},
	)
)

Metrics for general use. All metrics should start with pcap_ to indicate that they come from the packet-header system.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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