collector

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CWClient added in v1.2.0

type CWClient struct {
	// contains filtered or unexported fields
}

CWClient is a wrapper for AWS ecs client that implements helpers to get ECS clusters metrics

func NewCWClient added in v1.2.0

func NewCWClient(awsRegion string, roleArn string) (*CWClient, error)

NewCWClient create a Cloudwatch API client

func (*CWClient) GetClusterContainerInstancesMetrics added in v1.2.0

func (cw *CWClient) GetClusterContainerInstancesMetrics(instance *types.ECSContainerInstance) (*types.InstanceMetrics, error)

GetClusterContainerInstancesMetrics return metric for an instance

func (*CWClient) GetClusterMetrics added in v1.2.0

func (cw *CWClient) GetClusterMetrics(cluster *types.ECSCluster, metricName string) (float64, error)

GetClusterMetrics return metric for an cluster

type CWGatherer added in v1.2.0

type CWGatherer interface {
	GetClusterContainerInstancesMetrics(instance *types.ECSContainerInstance) (*types.InstanceMetrics, error)
	GetClusterMetrics(cluster *types.ECSCluster, metricName string) (float64, error)
}

CWGatherer is the interface that implements the methods required to gather cloudwath data

type ECSClient

type ECSClient struct {
	// contains filtered or unexported fields
}

ECSClient is a wrapper for AWS ecs client that implements helpers to get ECS clusters metrics

func NewECSClient

func NewECSClient(awsRegion string, roleArn string) (*ECSClient, error)

NewECSClient will return an initialized ECSClient

func (*ECSClient) GetClusterContainerInstances added in v1.1.0

func (e *ECSClient) GetClusterContainerInstances(cluster *types.ECSCluster) ([]*types.ECSContainerInstance, error)

GetClusterContainerInstances will return all the container instances from a cluster

func (*ECSClient) GetClusterScalableTargets added in v1.2.0

func (e *ECSClient) GetClusterScalableTargets(cluster *types.ECSCluster) ([]*types.ECSScalableTarget, error)

GetClusterScalableTargets will return all the scalable targets for the cluster

func (*ECSClient) GetClusterServices

func (e *ECSClient) GetClusterServices(cluster *types.ECSCluster) ([]*types.ECSService, error)

GetClusterServices will return all the services from a cluster

func (*ECSClient) GetClusters

func (e *ECSClient) GetClusters() ([]*types.ECSCluster, error)

GetClusters will get the clusters from the ECS API

type ECSGatherer

type ECSGatherer interface {
	GetClusters() ([]*types.ECSCluster, error)
	GetClusterServices(cluster *types.ECSCluster) ([]*types.ECSService, error)
	GetClusterScalableTargets(cluster *types.ECSCluster) ([]*types.ECSScalableTarget, error)
	GetClusterContainerInstances(cluster *types.ECSCluster) ([]*types.ECSContainerInstance, error)
}

ECSGatherer is the interface that implements the methods required to gather ECS data

type Exporter

type Exporter struct {
	sync.Mutex             // Our exporter object will be locakble to protect from concurrent scrapes
	ECSClient  ECSGatherer // Custom ECS client to get information from the clusters
	CWClient   CWGatherer  // Custom CW client to get information from the cloudwatch
	// contains filtered or unexported fields
}

Exporter collects ECS clusters metrics

func New

func New(awsRegion string, roleArn string, clusterFilterRegexp string, disableCIMetrics bool) (*Exporter, error)

New returns an initialized exporter

func (*Exporter) Collect

func (e *Exporter) Collect(ch chan<- prometheus.Metric)

Collect fetches the stats from configured ECS and delivers them as Prometheus metrics. It implements prometheus.Collector

func (*Exporter) Describe

func (e *Exporter) Describe(ch chan<- *prometheus.Desc)

Describe describes all the metrics ever exported by the ECS exporter. It implements prometheus.Collector.

Jump to

Keyboard shortcuts

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