Documentation
¶
Index ¶
- type BlockDeviceMetric
- type BlockDeviceMetricsWriter
- type CloudVolumeMetric
- type CloudVolumeMetricsWriter
- type Config
- type Controller
- type DiskStats
- type EBPFTracer
- type FilesystemMetric
- type FilesystemMetricsWriter
- type K8sPodVolumeMetric
- type K8sPodVolumeMetricsWriter
- type NodeStatsSummaryMetric
- type NodeStatsSummaryWriter
- type StorageInfoProvider
- type SysfsStorageInfoProvider
- func (s *SysfsStorageInfoProvider) CollectBlockDeviceMetrics(timestamp time.Time) ([]BlockDeviceMetric, error)
- func (s *SysfsStorageInfoProvider) CollectCloudVolumeMetrics(ctx context.Context) ([]CloudVolumeMetric, error)
- func (s *SysfsStorageInfoProvider) CollectFilesystemMetrics(ctx context.Context, timestamp time.Time) ([]FilesystemMetric, error)
- func (s *SysfsStorageInfoProvider) CollectNodeStatsSummary(ctx context.Context) (*NodeStatsSummaryMetric, error)
- func (s *SysfsStorageInfoProvider) CollectPodVolumeMetrics(ctx context.Context) ([]K8sPodVolumeMetric, error)
- type VolumePathInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockDeviceMetric ¶ added in v1.43.1
type BlockDeviceMetric struct {
Name string `avro:"name"`
NodeName string `avro:"node_name"`
NodeTemplate *string `avro:"node_template"`
Path string `avro:"path"`
SizeBytes *int64 `avro:"size_bytes"`
DiskType string `avro:"disk_type"` // HDD, SSD
PartitionOf string `avro:"partition_of"` // parent device for partitions
Holders []string `avro:"holders"` // devices using this device
IsVirtual bool `avro:"is_virtual"` // dm-* or md* devices
RaidLevel string `avro:"raid_level"` // raid0, raid1, raid5, etc
LVMInfo map[string]string `avro:"lvm_info"` // LVM metadata for this device
ReadIOPS float64 `avro:"read_iops"`
WriteIOPS float64 `avro:"write_iops"`
ReadThroughputBytes float64 `avro:"read_throughput_bytes"`
WriteThroughputBytes float64 `avro:"write_throughput_bytes"`
ReadLatencyMs float64 `avro:"read_latency_ms"`
WriteLatencyMs float64 `avro:"write_latency_ms"`
InFlightRequests int64 `avro:"in_flight_requests"`
AvgQueueDepth float64 `avro:"avg_queue_depth"`
Utilization float64 `avro:"utilization"`
Timestamp time.Time `avro:"ts"`
// contains filtered or unexported fields
}
BlockDeviceMetric represents enhanced block device metrics with accurate sector sizes
type BlockDeviceMetricsWriter ¶ added in v1.43.1
type BlockDeviceMetricsWriter interface {
Write(metrics ...BlockDeviceMetric) error
}
func NewBlockDeviceMetricsWriter ¶ added in v1.43.1
func NewBlockDeviceMetricsWriter(metricsClient custommetrics.MetricClient) (BlockDeviceMetricsWriter, error)
type CloudVolumeMetric ¶ added in v1.49.0
type CloudVolumeMetric struct {
NodeName string `avro:"node_name"`
NodeTemplate *string `avro:"node_template"`
CloudProvider string `avro:"cloud_provider"`
Zone string `avro:"zone"`
VolumeID string `avro:"volume_id"`
VolumeType string `avro:"volume_type"`
VolumeState string `avro:"volume_state"`
SizeBytes int64 `avro:"size_bytes"`
IOPS int32 `avro:"iops"`
ThroughputBytes int32 `avro:"throughput_bytes"`
Encrypted bool `avro:"encrypted"`
Timestamp time.Time `avro:"ts"`
}
CloudVolumeMetric represents cloud provider volume metadata and configuration
type CloudVolumeMetricsWriter ¶ added in v1.49.0
type CloudVolumeMetricsWriter interface {
Write(metrics ...CloudVolumeMetric) error
}
func NewCloudVolumeMetricsWriter ¶ added in v1.49.0
func NewCloudVolumeMetricsWriter(metricsClient custommetrics.MetricClient) (CloudVolumeMetricsWriter, error)
type Config ¶
type Config struct {
DataBatch config.DataBatchConfig `validate:"required"`
Netflow config.NetflowConfig `validate:"required"`
Events config.EventsConfig `validate:"required"`
Stats config.StatsConfig `validate:"required"`
ProcessTree config.ProcessTreeConfig `validate:"required"`
}
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController( log *logging.Logger, cfg Config, exporters []export.DataBatchWriter, containersClient containersClient, ct conntrackClient, tracer EBPFTracer, signatureEngine signatureEngine, kubeClient kubepb.KubeAPIClient, processTreeCollector processTreeCollector, procHandler procHandler, enrichmentService enrichmentService, blockDeviceMetricsWriter BlockDeviceMetricsWriter, filesystemMetricsWriter FilesystemMetricsWriter, storageInfoProvider StorageInfoProvider, nodeStatsSummaryWriter NodeStatsSummaryWriter, podVolumeMetricsWriter K8sPodVolumeMetricsWriter, cloudVolumeMetricsWriter CloudVolumeMetricsWriter, ) *Controller
func (*Controller) IsMutedNamespace ¶
func (c *Controller) IsMutedNamespace(namespace string) bool
func (*Controller) MuteNamespace ¶
func (c *Controller) MuteNamespace(namespace string) error
type DiskStats ¶ added in v1.46.0
type DiskStats struct {
Name string
ReadIOs uint64
ReadMerges uint64
ReadSectors uint64
ReadTicks uint64
WriteIOs uint64
WriteMerges uint64
WriteSectors uint64
WriteTicks uint64
InFlight uint64
IOTicks uint64
TimeInQueue uint64
Timestamp time.Time
}
DiskStats represents raw I/O statistics from /proc/diskstats
type EBPFTracer ¶ added in v1.48.2
type EBPFTracer interface {
Events() <-chan *types.Event
MuteEventsFromCgroup(cgroup uint64, reason string) error
MuteEventsFromCgroups(cgroups []uint64, reason string) error
UnmuteEventsFromCgroup(cgroup uint64) error
ReadSyscallStats() (map[ebpftracer.SyscallStatsKeyCgroupID][]ebpftracer.SyscallStats, error)
CollectNetworkSummary() ([]ebpftracer.TrafficKey, []ebpftracer.TrafficSummary, error)
CollectFileAccessStats() ([]ebpftracer.FileAccessKey, []ebpftracer.FileAccessStats, error)
GetEventName(id events.ID) string
GetDNSNameFromCache(cgroupID uint64, addr netip.Addr) string
RemoveCgroupFromDNSCache(cgroup uint64)
}
type FilesystemMetric ¶ added in v1.43.1
type FilesystemMetric struct {
Devices []string `avro:"devices"`
NodeName string `avro:"node_name"`
NodeTemplate *string `avro:"node_template"`
MountPoint string `avro:"mount_point"`
Type string `avro:"type"` // Filesystem type (ext4, xfs, btrfs, etc.)
Options []string `avro:"options"` // Mount options
TotalBytes *int64 `avro:"total_bytes"`
Labels map[string]string `avro:"labels"`
UsedBytes *int64 `avro:"used_bytes"`
TotalInodes *int64 `avro:"total_inodes"`
UsedInodes *int64 `avro:"used_inodes"`
Timestamp time.Time `avro:"ts"`
// PV name for joining with K8sPodVolumeMetric (nil for node-level filesystems)
PVName *string `avro:"pv_name"`
}
type FilesystemMetricsWriter ¶ added in v1.43.1
type FilesystemMetricsWriter interface {
Write(metrics ...FilesystemMetric) error
}
func NewFilesystemMetricsWriter ¶ added in v1.43.1
func NewFilesystemMetricsWriter(metricsClient custommetrics.MetricClient) (FilesystemMetricsWriter, error)
type K8sPodVolumeMetric ¶ added in v1.48.4
type K8sPodVolumeMetric struct {
NodeName string `avro:"node_name"`
NodeTemplate *string `avro:"node_template"`
Namespace string `avro:"namespace"`
PodName string `avro:"pod_name"`
PodUID string `avro:"pod_uid"`
ControllerKind string `avro:"controller_kind"`
ControllerName string `avro:"controller_name"`
ContainerName string `avro:"container_name"`
VolumeName string `avro:"volume_name"`
MountPath string `avro:"mount_path"`
PVCName *string `avro:"pvc_name"`
RequestedSizeBytes *int64 `avro:"requested_size_bytes"`
PVName *string `avro:"pv_name"`
StorageClass *string `avro:"storage_class"`
CSIDriver *string `avro:"csi_driver"`
CSIVolumeHandle *string `avro:"csi_volume_handle"` // For EBS: vol-xxx, can be joined with block_device.ebs_volume_id
VolumeMode string `avro:"volume_mode"` // "Filesystem" or "Block"
DevicePath *string `avro:"device_path"` // For block volumes: container's volumeDevices[].devicePath
Timestamp time.Time `avro:"ts"`
}
K8sPodVolumeMetric represents pod volume information from Kubernetes
type K8sPodVolumeMetricsWriter ¶ added in v1.48.4
type K8sPodVolumeMetricsWriter interface {
Write(metrics ...K8sPodVolumeMetric) error
}
func NewK8sPodVolumeMetricsWriter ¶ added in v1.48.4
func NewK8sPodVolumeMetricsWriter(metricsClient custommetrics.MetricClient) (K8sPodVolumeMetricsWriter, error)
type NodeStatsSummaryMetric ¶ added in v1.46.0
type NodeStatsSummaryMetric struct {
NodeName string `avro:"node_name"`
NodeTemplate *string `avro:"node_template"`
ImageFsSizeBytes *int64 `avro:"image_fs_size_bytes"`
ImageFsUsedBytes *int64 `avro:"image_fs_used_bytes"`
ContainerFsSizeBytes *int64 `avro:"container_fs_size_bytes"`
ContainerFsUsedBytes *int64 `avro:"container_fs_used_bytes"`
Timestamp time.Time `avro:"ts"`
}
NodeStatsSummaryMetric represents node-level filesystem statistics from kubelet
type NodeStatsSummaryWriter ¶ added in v1.46.0
type NodeStatsSummaryWriter interface {
Write(metrics ...NodeStatsSummaryMetric) error
}
func NewNodeStatsSummaryWriter ¶ added in v1.46.0
func NewNodeStatsSummaryWriter(metricsClient custommetrics.MetricClient) (NodeStatsSummaryWriter, error)
type StorageInfoProvider ¶ added in v1.43.1
type StorageInfoProvider interface {
CollectFilesystemMetrics(ctx context.Context, timestamp time.Time) ([]FilesystemMetric, error)
CollectBlockDeviceMetrics(timestamp time.Time) ([]BlockDeviceMetric, error)
CollectNodeStatsSummary(ctx context.Context) (*NodeStatsSummaryMetric, error)
CollectPodVolumeMetrics(ctx context.Context) ([]K8sPodVolumeMetric, error)
CollectCloudVolumeMetrics(ctx context.Context) ([]CloudVolumeMetric, error)
}
func NewStorageInfoProvider ¶ added in v1.43.1
func NewStorageInfoProvider(log *logging.Logger, kubeClient kubepb.KubeAPIClient, clusterID string) (StorageInfoProvider, error)
type SysfsStorageInfoProvider ¶ added in v1.43.1
type SysfsStorageInfoProvider struct {
// contains filtered or unexported fields
}
func (*SysfsStorageInfoProvider) CollectBlockDeviceMetrics ¶ added in v1.50.0
func (s *SysfsStorageInfoProvider) CollectBlockDeviceMetrics(timestamp time.Time) ([]BlockDeviceMetric, error)
func (*SysfsStorageInfoProvider) CollectCloudVolumeMetrics ¶ added in v1.49.0
func (s *SysfsStorageInfoProvider) CollectCloudVolumeMetrics(ctx context.Context) ([]CloudVolumeMetric, error)
CollectCloudVolumeMetrics retrieves cloud volume metadata from the cloud provider and builds metrics
func (*SysfsStorageInfoProvider) CollectFilesystemMetrics ¶ added in v1.50.0
func (s *SysfsStorageInfoProvider) CollectFilesystemMetrics(ctx context.Context, timestamp time.Time) ([]FilesystemMetric, error)
func (*SysfsStorageInfoProvider) CollectNodeStatsSummary ¶ added in v1.46.0
func (s *SysfsStorageInfoProvider) CollectNodeStatsSummary(ctx context.Context) (*NodeStatsSummaryMetric, error)
CollectNodeStatsSummary retrieves node stats summary from the controller and builds a metric
func (*SysfsStorageInfoProvider) CollectPodVolumeMetrics ¶ added in v1.48.4
func (s *SysfsStorageInfoProvider) CollectPodVolumeMetrics(ctx context.Context) ([]K8sPodVolumeMetric, error)
CollectPodVolumeMetrics retrieves pod volume information from the controller
type VolumePathInfo ¶ added in v1.48.4
VolumePathInfo contains extracted information from a volume mount path.
func ParseVolumeMountPath ¶ added in v1.48.4
func ParseVolumeMountPath(mountPath string) *VolumePathInfo
ParseVolumeMountPath extracts pod and volume info from a kubelet mount path. Returns nil if the path is not a pod volume mount.