Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrDockerListFailed Error occurred when docker failed to list containers ErrDockerListFailed = errors.New("failed to list containers") )
Functions ¶
func ContainerJSONObjectToTargetObject ¶
ContainerJSONObjectToTargetObject Convert Container Object to Target Object Add labels to target
Types ¶
type Container ¶
type Container types.ContainerJSON
Container Object to wrap the Docker ContainerJSON Object
func (Container) GetHost ¶
GetHost Return the IP Addr or Hostname of container Precedence value:
- From the 'prometheus.io/host' label.
- From the IP Address field of NetworkSettings struct.
- From the first IP Address available when loop on Networks map of NetworkSettings struct.
func (Container) GetImage ¶
func (c Container) GetImage() ContainerImage
GetImage compute and return an ContainerImage Object from Container config
func (Container) GetMetricsPath ¶
GetMetricsPath Return the port of container Precedence value:
- From the 'prometheus.io/path' label.
- Default value: /metrics
type ContainerImage ¶
ContainerImage Object
func (ContainerImage) GetName ¶
func (i ContainerImage) GetName() string
GetName return the image name of Container
func (ContainerImage) GetVersion ¶
func (i ContainerImage) GetVersion() string
GetVersion return the image version of Container
Click to show internal directories.
Click to hide internal directories.