Back to / receiver / vmmetricsreceiver

Package vmmetricsreceiver

Latest Go to latest
Published: Jun 16, 2020 | License: Apache-2.0 | Module:


Package vmmetricsreceiver has the logic for scraping VM metrics and then passing them onto a metric consumer instance.


Package Files

type Config

type Config struct {
	configmodels.ReceiverSettings `mapstructure:",squash"`
	ScrapeInterval                time.Duration `mapstructure:"scrape_interval"`
	MountPoint                    string        `mapstructure:"mount_point"`
	ProcessMountPoint             string        `mapstructure:"process_mount_point"`
	MetricPrefix                  string        `mapstructure:"metric_prefix"`

Config defines configuration for VMMetrics receiver.

type Factory

type Factory struct {

Factory is the Factory for receiver.

func (*Factory) CreateDefaultConfig

func (f *Factory) CreateDefaultConfig() configmodels.Receiver

CreateDefaultConfig creates the default configuration for receiver.

func (*Factory) CreateMetricsReceiver

func (f *Factory) CreateMetricsReceiver(
	logger *zap.Logger,
	config configmodels.Receiver,
	consumer consumer.MetricsConsumerOld,
) (component.MetricsReceiver, error)

CreateMetricsReceiver creates a metrics receiver based on provided config.

func (*Factory) CreateTraceReceiver

func (f *Factory) CreateTraceReceiver(
	ctx context.Context,
	logger *zap.Logger,
	cfg configmodels.Receiver,
	nextConsumer consumer.TraceConsumerOld,
) (component.TraceReceiver, error)

CreateTraceReceiver creates a trace receiver based on provided config.

func (*Factory) CustomUnmarshaler

func (f *Factory) CustomUnmarshaler() component.CustomUnmarshaler

CustomUnmarshaler returns custom unmarshaler for this config.

func (*Factory) Type

func (f *Factory) Type() configmodels.Type

Type gets the type of the Receiver config created by this Factory.

type Receiver

type Receiver struct {
	// contains filtered or unexported fields

Receiver is the type used to handle metrics from VM metrics.

func (*Receiver) Shutdown

func (vmr *Receiver) Shutdown(context.Context) error

Shutdown stops and cancels the underlying VM metrics scrapers.

func (*Receiver) Start

func (vmr *Receiver) Start(ctx context.Context, host component.Host) error

Start scrapes VM metrics based on the OS platform.

type VMMetricsCollector

type VMMetricsCollector struct {
	// contains filtered or unexported fields

VMMetricsCollector is a struct that collects and reports VM and process metrics (cpu, mem, etc).

func NewVMMetricsCollector

func NewVMMetricsCollector(si time.Duration, mountPoint, processMountPoint, prefix string, consumer consumer.MetricsConsumerOld) (*VMMetricsCollector, error)

NewVMMetricsCollector creates a new set of VM and Process Metrics (mem, cpu).

func (*VMMetricsCollector) StartCollection

func (vmc *VMMetricsCollector) StartCollection()

StartCollection starts a ticker'd goroutine that will scrape and export vm metrics periodically.

func (*VMMetricsCollector) StopCollection

func (vmc *VMMetricsCollector) StopCollection()

StopCollection stops the collection of metric information

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier