metrics

package
v0.23.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector added in v0.22.5

type Collector[K comparable] struct {
	// contains filtered or unexported fields
}

func NewCollector added in v0.22.5

func NewCollector[K comparable](description string, gv *prometheus.GaugeVec) *Collector[K]

func (*Collector[K]) Description added in v0.22.5

func (c *Collector[K]) Description() string

func (*Collector[K]) GaugeVec added in v0.22.5

func (c *Collector[K]) GaugeVec() *prometheus.GaugeVec

func (*Collector[K]) Get added in v0.22.5

func (c *Collector[K]) Get(k K) (uint64, bool)

func (*Collector[K]) Reset added in v0.22.5

func (c *Collector[K]) Reset()

func (*Collector[K]) Set added in v0.22.5

func (c *Collector[K]) Set(k K, v uint64)

func (*Collector[K]) Total added in v0.22.5

func (c *Collector[K]) Total() uint64

func (*Collector[K]) Values added in v0.22.5

func (c *Collector[K]) Values() map[K]uint64

type EventCollector added in v0.22.5

type EventCollector struct {
	// contains filtered or unexported fields
}

func NewEventCollector added in v0.22.5

func NewEventCollector(description string, gv *prometheus.GaugeVec) *EventCollector

func (*EventCollector) Description added in v0.22.5

func (ec *EventCollector) Description() string

func (*EventCollector) GaugeVec added in v0.22.5

func (ec *EventCollector) GaugeVec() *prometheus.GaugeVec

func (*EventCollector) Get added in v0.22.5

func (ec *EventCollector) Get(id events.ID) uint64

func (*EventCollector) Log added in v0.22.5

func (ec *EventCollector) Log()

func (*EventCollector) MarshalJSON added in v0.23.0

func (ec *EventCollector) MarshalJSON() ([]byte, error)

func (*EventCollector) Reset added in v0.22.5

func (ec *EventCollector) Reset()

func (*EventCollector) Set added in v0.22.5

func (ec *EventCollector) Set(id events.ID, v uint64)

func (*EventCollector) Total added in v0.22.5

func (ec *EventCollector) Total() uint64

func (*EventCollector) Values added in v0.22.5

func (ec *EventCollector) Values() map[events.ID]uint64

type Stats

type Stats struct {
	EventCount       *counter.Counter `json:"EventCount"`
	EventsFiltered   *counter.Counter `json:"EventsFiltered"`
	NetCapCount      *counter.Counter `json:"NetCapCount"` // network capture events
	BPFLogsCount     *counter.Counter `json:"BPFLogsCount"`
	ErrorCount       *counter.Counter `json:"ErrorCount"`
	LostEvCount      *counter.Counter `json:"LostEvCount"`
	LostWrCount      *counter.Counter `json:"LostWrCount"`
	LostNtCapCount   *counter.Counter `json:"LostNtCapCount"` // lost network capture events
	LostBPFLogsCount *counter.Counter `json:"LostBPFLogsCount"`

	// NOTE: BPFPerfEventSubmit* metrics are periodically collected from the 'events_stats'
	// BPF map, while userspace metrics are continuously updated within the application
	// based on varying logic. Due to differences in data sources and collection timing,
	// the two sets of metrics are not directly synchronized. As a result, the total event
	// counts fetched from 'events_stats' may not align with those reported by userspace metrics.
	// Each metric set is designed to provide distinct insights and should be analyzed
	// independently, without direct comparison.
	BPFPerfEventSubmitAttemptsCount *EventCollector `json:"BPFPerfEventSubmitAttemptsCount,omitempty"`
	BPFPerfEventSubmitFailuresCount *EventCollector `json:"BPFPerfEventSubmitFailuresCount,omitempty"`
}

When updating this struct, please make sure to update the relevant exporting functions

func NewStats added in v0.22.5

func NewStats() *Stats

func (*Stats) MarshalJSON added in v0.23.0

func (s *Stats) MarshalJSON() ([]byte, error)

func (*Stats) RegisterPrometheus added in v0.8.0

func (s *Stats) RegisterPrometheus() error

Register Stats to prometheus metrics exporter

Jump to

Keyboard shortcuts

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