Documentation ¶
Overview ¶
Package metricsmap represents the BPF metrics map in the BPF programs. It is implemented as a hash table containing an entry of different drop and forward counts for different drop/forward reasons and directions.
Index ¶
Constants ¶
const ( // MapName for metrics map. MapName = "cilium_metrics" // MaxEntries is the maximum number of keys that can be present in the // Metrics Map. MaxEntries = 65536 )
Variables ¶
var ( // Metrics is the bpf metrics map Metrics *bpf.Map )
Functions ¶
func SyncMetricsMap ¶
SyncMetricsMap is called periodically to sync off the metrics map by aggregating it into drops (by drop reason and direction) and forwards (by direction) with the prometheus server.
Types ¶
type Key ¶
type Key struct { Reason uint8 `align:"reason"` Dir uint8 `align:"dir"` Reserved [3]uint16 `align:"reserved"` }
Key must be in sync with struct metrics_key in <bpf/lib/common.h>
func (*Key) DropForwardReason ¶
DropForwardReason gets the forwarded/dropped reason in human readable string format
type Value ¶
Value must be in sync with struct metrics_value in <bpf/lib/common.h>
func (*Value) CountFloat ¶
CountFloat converts the request count to float
func (*Value) GetValuePtr ¶
GetValuePtr returns the unsafe pointer to the BPF value.
func (*Value) RequestBytes ¶
RequestBytes returns drop/forward bytes in a human readable string format
func (*Value) RequestCount ¶
RequestCount returns the drop/forward count in a human readable string format