vmmetricsreceiver

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

README

VM Metrics Receiver

Collects metrics from the host operating system. This is applicable when the OpenTelemetry Collector is running as an agent.

receivers:
  vmmetrics:
    scrape_interval: 10s
    metric_prefix: "testmetric"
    mount_point: "/proc"
    #process_mount_point: "/data/proc" # Only using when running as an agent / daemonset

The full list of settings exposed for this receiver are documented here with detailed sample configurations here.

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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(ctx context.Context, logger *zap.Logger, cfg configmodels.Receiver, nextConsumer 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

Jump to

Keyboard shortcuts

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