docker

package
v0.0.0-...-be347a3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package docker is a Metricbeat module that contains MetricSets.

Index

Constants

This section is empty.

Variables

View Source
var HostParser = parse.URLHostParserBuilder{DefaultScheme: "tcp"}.Build()

Functions

func AssetDocker

func AssetDocker() string

AssetDocker returns asset data. This is the base64 encoded gzipped contents of ../metricbeat/module/docker.

func DeDotLabels

func DeDotLabels(labels map[string]string, dedot bool) common.MapStr

DeDotLabels returns a new common.MapStr containing a copy of the labels where the dots have been converted into nested structure, avoiding possible mapping errors

func ExtractContainerName

func ExtractContainerName(names []string) string

func NewDockerClient

func NewDockerClient(endpoint string, config Config) (*client.Client, error)

NewDockerClient initializes and returns a new Docker client

func NewModule

func NewModule(base mb.BaseModule) (mb.Module, error)

Types

type Config

type Config struct {
	TLS   *TLSConfig `config:"ssl"`
	DeDot bool       `config:"labels.dedot"`
}

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns default module config

type Container

type Container struct {
	ID     string
	Name   string
	Image  string
	Labels common.MapStr
}

func NewContainer

func NewContainer(container *types.Container, dedot bool) *Container

NewContainer converts Docker API container to an internal structure, it applies dedot to container labels if dedot is true, or stores them in a nested way if it's false

func (*Container) ToMapStr

func (c *Container) ToMapStr() common.MapStr

type Stat

type Stat struct {
	Container *types.Container
	Stats     types.StatsJSON
}

func FetchStats

func FetchStats(client *client.Client, timeout time.Duration) ([]Stat, error)

FetchStats returns a list of running containers with all related stats inside

type TLSConfig

type TLSConfig struct {
	Enabled     *bool  `config:"enabled"`
	CA          string `config:"certificate_authority"`
	Certificate string `config:"certificate"`
	Key         string `config:"key"`
}

func (*TLSConfig) IsEnabled

func (c *TLSConfig) IsEnabled() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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