docker

package
v4.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package docker contains a monitor for getting metrics about containers running in a docker engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertStatsToMetrics

func ConvertStatsToMetrics(container *dtypes.ContainerJSON, parsed *dtypes.StatsJSON, enhancedMetricsConfig EnhancedMetricsConfig) ([]*datapoint.Datapoint, error)

ConvertStatsToMetrics converts a docker container stats object into an array of datapoints

Types

type Config

type Config struct {
	config.MonitorConfig  `acceptsEndpoints:"false"`
	EnhancedMetricsConfig `yaml:",inline"`

	// The URL of the docker server
	DockerURL string `yaml:"dockerURL" default:"unix:///var/run/docker.sock"`
	// The maximum amount of time to wait for docker API requests
	TimeoutSeconds int `yaml:"timeoutSeconds" default:"5"`
	// A mapping of container label names to dimension names. The corresponding
	// label values will become the dimension value for the mapped name.  E.g.
	// `io.kubernetes.container.name: container_spec_name` would result in a
	// dimension called `container_spec_name` that has the value of the
	// `io.kubernetes.container.name` container label.
	LabelsToDimensions map[string]string `yaml:"labelsToDimensions"`
	// A mapping of container environment variable names to dimension
	// names.  The corresponding env var values become the dimension values on
	// the emitted metrics.  E.g. `APP_VERSION: version` would result in
	// datapoints having a dimension called `version` whose value is the value
	// of the `APP_VERSION` envvar configured for that particular container, if
	// present.
	EnvToDimensions map[string]string `yaml:"envToDimensions"`
	// A list of filters of images to exclude.  Supports literals, globs, and
	// regex.
	ExcludedImages []string `yaml:"excludedImages"`
}

Config for this monitor

type EnhancedMetricsConfig

type EnhancedMetricsConfig struct {
	// Whether it will send all extra block IO metrics as well.
	EnableExtraBlockIOMetrics bool `yaml:"enableExtraBlockIOMetrics" default:"false"`
	// Whether it will send all extra CPU metrics as well.
	EnableExtraCPUMetrics bool `yaml:"enableExtraCPUMetrics" default:"false"`
	// Whether it will send all extra memory metrics as well.
	EnableExtraMemoryMetrics bool `yaml:"enableExtraMemoryMetrics" default:"false"`
	// Whether it will send all extra network metrics as well.
	EnableExtraNetworkMetrics bool `yaml:"enableExtraNetworkMetrics" default:"false"`
}

EnhancedMetricsConfig to decide if it will send out all custom metrics

type Monitor

type Monitor struct {
	Output types.Output
	// contains filtered or unexported fields
}

Monitor for Docker

func (*Monitor) Configure

func (m *Monitor) Configure(conf *Config) error

Configure the monitor and kick off volume metric syncing

func (*Monitor) Shutdown

func (m *Monitor) Shutdown()

Shutdown stops the metric sync

Jump to

Keyboard shortcuts

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