// New create a new instance of the container MetricSet func New(base mb.BaseMetricSet) (mb.MetricSet, error) { logp.Warn("EXPERIMENTAL: The container metricset is experimental") config := docker.GetDefaultConf() if err := base.Module().UnpackConfig(&config); err != nil { return nil, err } client, err := docker.NewDockerClient(&config) if err != nil { return nil, err } return &MetricSet{ BaseMetricSet: base, dockerClient: client, }, nil }
// New create a new instance of the docker diskio MetricSet func New(base mb.BaseMetricSet) (mb.MetricSet, error) { logp.Warn("EXPERIMENTAL: The diskio metricset is experimental") config := docker.GetDefaultConf() if err := base.Module().UnpackConfig(&config); err != nil { return nil, err } client, err := docker.NewDockerClient(&config) if err != nil { return nil, err } return &MetricSet{ BaseMetricSet: base, dockerClient: client, blkioService: &BLkioService{ BlkioSTatsPerContainer: make(map[string]BlkioRaw), }, }, nil }
// New create a new instance of the docker network MetricSet func New(base mb.BaseMetricSet) (mb.MetricSet, error) { logp.Warn("EXPERIMENTAL: The network metricset is experimental") config := docker.GetDefaultConf() if err := base.Module().UnpackConfig(&config); err != nil { return nil, err } client, err := docker.NewDockerClient(&config) if err != nil { return nil, err } return &MetricSet{ BaseMetricSet: base, dockerClient: client, netService: &NETService{ NetworkStatPerContainer: make(map[string]map[string]NETRaw), }, }, nil }