Documentation
¶
Index ¶
- Variables
- func NewFactory() receiver.Factory
- type Config
- type MetricScraper
- type PS
- type SystemPS
- func (s *SystemPS) CPUTimes(ctx context.Context) ([]cpu.TimesStat, error)
- func (s *SystemPS) Close()
- func (s *SystemPS) DiskUsage(ctx context.Context) ([]*disk.UsageStat, error)
- func (s *SystemPS) EthtoolStats(_ context.Context, iface string) (map[string]uint64, error)
- func (s *SystemPS) VMStat(ctx context.Context) (*mem.VirtualMemoryStat, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Type = component.MustNewType(typeStr)
Functions ¶
func NewFactory ¶
Types ¶
type Config ¶
type Config struct {
scraperhelper.ControllerConfig `mapstructure:",squash"`
}
type MetricScraper ¶
type MetricScraper interface {
// Name returns the scraper identifier for logging/debugging.
Name() string
// Scrape collects metrics and appends them to the provided pmetric.Metrics.
Scrape(ctx context.Context, metrics pmetric.Metrics) error
}
MetricScraper defines the interface for individual metric scrapers. Each scraper is responsible for collecting a specific type of metrics.
type PS ¶
type PS interface {
CPUTimes(ctx context.Context) ([]cpu.TimesStat, error)
VMStat(ctx context.Context) (*mem.VirtualMemoryStat, error)
DiskUsage(ctx context.Context) ([]*disk.UsageStat, error)
EthtoolStats(ctx context.Context, iface string) (map[string]uint64, error)
}
PS abstracts OS-level data sources for testing.
Click to show internal directories.
Click to hide internal directories.