Documentation ¶
Index ¶
- Constants
- func StartECSServiceDiscovery(sd *ServiceDiscovery, shutDownChan chan interface{}, wg *sync.WaitGroup)
- type ContainerInstanceProcessor
- type DecoratedTask
- type DockerLabelConfig
- type DockerLabelDiscoveryProcessor
- type EC2MetaData
- type Processor
- type ProcessorStats
- type PrometheusTarget
- type ServiceDiscovery
- type ServiceDiscoveryConfig
- type ServiceDiscoveryError
- type ServiceEndpointDiscoveryProcessor
- type ServiceNameForTasksConfig
- type TargetsExportProcessor
- type TaskDefinitionConfig
- type TaskDefinitionDiscoveryProcessor
- type TaskDefinitionProcessor
- type TaskFilterProcessor
- type TaskProcessor
Constants ¶
View Source
const ( AWSAPIDescribeContainerInstances = "AWSCLI_DescribeContainerInstances" AWSCLIDescribeInstancesRequest = "AWSCLI_DescribeInstancesRequest" AWSCLIDescribeTaskDefinition = "AWSCLI_DescribeTaskDefinition" AWSCLIListServices = "AWSCLI_ListServices" AWSCLIListTasks = "AWSCLI_ListTasks" AWSCLIDescribeTasks = "AWSCLI_DescribeTasks" LRUCacheGetEC2MetaData = "LRUCache_Get_EC2MetaData" LRUCacheGetTaskDefinition = "LRUCache_Get_TaskDefinition" LRUCacheSizeContainerInstance = "LRUCache_Size_ContainerInstance" LRUCacheSizeTaskDefinition = "LRUCache_Size_TaskDefinition" ExporterDiscoveredTargetCount = "Exporter_DiscoveredTargetCount" )
View Source
const (
AwsSdkLevelRetryCount = 3
)
Variables ¶
This section is empty.
Functions ¶
func StartECSServiceDiscovery ¶
func StartECSServiceDiscovery(sd *ServiceDiscovery, shutDownChan chan interface{}, wg *sync.WaitGroup)
Types ¶
type ContainerInstanceProcessor ¶
type ContainerInstanceProcessor struct {
// contains filtered or unexported fields
}
Add the Container instance metadata for ECS Clusters on Linux EC2 Instances
func NewContainerInstanceProcessor ¶
func NewContainerInstanceProcessor(ecs *ecs.ECS, ec2 *ec2.EC2, s *ProcessorStats) *ContainerInstanceProcessor
func (*ContainerInstanceProcessor) Process ¶
func (p *ContainerInstanceProcessor) Process(cluster string, taskList []*DecoratedTask) ([]*DecoratedTask, error)
func (*ContainerInstanceProcessor) ProcessorName ¶
func (p *ContainerInstanceProcessor) ProcessorName() string
type DecoratedTask ¶
type DecoratedTask struct { Task *ecs.Task TaskDefinition *ecs.TaskDefinition EC2Info *EC2MetaData ServiceName string DockerLabelBased bool TaskDefinitionBased bool }
func (*DecoratedTask) ExporterInformation ¶
func (t *DecoratedTask) ExporterInformation(config *ServiceDiscoveryConfig, dockerLabelRegex *regexp.Regexp, targets map[string]*PrometheusTarget)
func (*DecoratedTask) String ¶
func (t *DecoratedTask) String() string
type DockerLabelConfig ¶
type DockerLabelDiscoveryProcessor ¶
type DockerLabelDiscoveryProcessor struct {
// contains filtered or unexported fields
}
Tag the Tasks that matched the Docker Label based SD Discovery
func NewDockerLabelDiscoveryProcessor ¶
func NewDockerLabelDiscoveryProcessor(d *DockerLabelConfig) *DockerLabelDiscoveryProcessor
func (*DockerLabelDiscoveryProcessor) Process ¶
func (p *DockerLabelDiscoveryProcessor) Process(cluster string, taskList []*DecoratedTask) ([]*DecoratedTask, error)
func (*DockerLabelDiscoveryProcessor) ProcessorName ¶
func (p *DockerLabelDiscoveryProcessor) ProcessorName() string
type EC2MetaData ¶
type Processor ¶
type Processor interface { Process(cluster string, taskList []*DecoratedTask) ([]*DecoratedTask, error) ProcessorName() string }
type ProcessorStats ¶
type ProcessorStats struct {
// contains filtered or unexported fields
}
func (*ProcessorStats) AddStats ¶
func (sd *ProcessorStats) AddStats(name string)
func (*ProcessorStats) AddStatsCount ¶
func (sd *ProcessorStats) AddStatsCount(name string, count int)
func (*ProcessorStats) GetStats ¶
func (sd *ProcessorStats) GetStats(name string) int
func (*ProcessorStats) ResetStats ¶
func (sd *ProcessorStats) ResetStats()
func (*ProcessorStats) ShowStats ¶
func (sd *ProcessorStats) ShowStats()
type PrometheusTarget ¶
type ServiceDiscovery ¶
type ServiceDiscovery struct { Config *ServiceDiscoveryConfig // contains filtered or unexported fields }
type ServiceDiscoveryConfig ¶
type ServiceDiscoveryConfig struct { Frequency string `toml:"sd_frequency"` ResultFile string `toml:"sd_result_file"` TargetCluster string `toml:"sd_target_cluster"` TargetClusterRegion string `toml:"sd_cluster_region"` ServiceNamesForTasks []*ServiceNameForTasksConfig `toml:"service_name_list_for_tasks"` DockerLabel *DockerLabelConfig `toml:"docker_label"` TaskDefinitions []*TaskDefinitionConfig `toml:"task_definition_list"` }
type ServiceDiscoveryError ¶
type ServiceDiscoveryError struct {
// contains filtered or unexported fields
}
func (ServiceDiscoveryError) Error ¶
func (p ServiceDiscoveryError) Error() string
type ServiceEndpointDiscoveryProcessor ¶ added in v1.247347.1
type ServiceEndpointDiscoveryProcessor struct {
// contains filtered or unexported fields
}
Tag the Tasks that match the Service Name based Service Discovery
func NewServiceEndpointDiscoveryProcessor ¶ added in v1.247347.1
func NewServiceEndpointDiscoveryProcessor(ecs *ecs.ECS, serviceNamesForTasks []*ServiceNameForTasksConfig, s *ProcessorStats) *ServiceEndpointDiscoveryProcessor
func (*ServiceEndpointDiscoveryProcessor) Process ¶ added in v1.247347.1
func (p *ServiceEndpointDiscoveryProcessor) Process(cluster string, taskList []*DecoratedTask) ([]*DecoratedTask, error)
func (*ServiceEndpointDiscoveryProcessor) ProcessorName ¶ added in v1.247347.1
func (p *ServiceEndpointDiscoveryProcessor) ProcessorName() string
type ServiceNameForTasksConfig ¶ added in v1.247347.1
type ServiceNameForTasksConfig struct { ContainerNamePattern string `toml:"sd_container_name_pattern"` JobName string `toml:"sd_job_name"` MetricsPath string `toml:"sd_metrics_path"` MetricsPorts string `toml:"sd_metrics_ports"` ServiceNamePattern string `toml:"sd_service_name_pattern"` // contains filtered or unexported fields }
func (*ServiceNameForTasksConfig) String ¶ added in v1.247347.1
func (s *ServiceNameForTasksConfig) String() string
type TargetsExportProcessor ¶
type TargetsExportProcessor struct {
// contains filtered or unexported fields
}
func NewTargetsExportProcessor ¶
func NewTargetsExportProcessor(sdConfig *ServiceDiscoveryConfig, s *ProcessorStats) *TargetsExportProcessor
func (*TargetsExportProcessor) Process ¶
func (p *TargetsExportProcessor) Process(cluster string, taskList []*DecoratedTask) ([]*DecoratedTask, error)
func (*TargetsExportProcessor) ProcessorName ¶
func (p *TargetsExportProcessor) ProcessorName() string
type TaskDefinitionConfig ¶
type TaskDefinitionConfig struct { ContainerNamePattern string `toml:"sd_container_name_pattern"` JobName string `toml:"sd_job_name"` MetricsPath string `toml:"sd_metrics_path"` MetricsPorts string `toml:"sd_metrics_ports"` TaskDefArnPattern string `toml:"sd_task_definition_arn_pattern"` // contains filtered or unexported fields }
func (*TaskDefinitionConfig) String ¶
func (t *TaskDefinitionConfig) String() string
type TaskDefinitionDiscoveryProcessor ¶
type TaskDefinitionDiscoveryProcessor struct {
// contains filtered or unexported fields
}
Tag the Tasks that match the Task Definition ARN based Service Discovery
func NewTaskDefinitionDiscoveryProcessor ¶
func NewTaskDefinitionDiscoveryProcessor(taskDefinitions []*TaskDefinitionConfig) *TaskDefinitionDiscoveryProcessor
func (*TaskDefinitionDiscoveryProcessor) Process ¶
func (p *TaskDefinitionDiscoveryProcessor) Process(cluster string, taskList []*DecoratedTask) ([]*DecoratedTask, error)
func (*TaskDefinitionDiscoveryProcessor) ProcessorName ¶
func (p *TaskDefinitionDiscoveryProcessor) ProcessorName() string
type TaskDefinitionProcessor ¶
type TaskDefinitionProcessor struct {
// contains filtered or unexported fields
}
Decorate the tasks with the ECS task definition
func NewTaskDefinitionProcessor ¶
func NewTaskDefinitionProcessor(ecs *ecs.ECS, s *ProcessorStats) *TaskDefinitionProcessor
func (*TaskDefinitionProcessor) Process ¶
func (p *TaskDefinitionProcessor) Process(cluster string, taskList []*DecoratedTask) ([]*DecoratedTask, error)
func (*TaskDefinitionProcessor) ProcessorName ¶
func (p *TaskDefinitionProcessor) ProcessorName() string
type TaskFilterProcessor ¶
type TaskFilterProcessor struct { }
Filter out the tasks not matching the discovery configs Filter out the tasks with nil task definition
func NewTaskFilterProcessor ¶
func NewTaskFilterProcessor() *TaskFilterProcessor
func (*TaskFilterProcessor) Process ¶
func (p *TaskFilterProcessor) Process(cluster string, taskList []*DecoratedTask) ([]*DecoratedTask, error)
func (*TaskFilterProcessor) ProcessorName ¶
func (p *TaskFilterProcessor) ProcessorName() string
type TaskProcessor ¶
type TaskProcessor struct {
// contains filtered or unexported fields
}
Get all running tasks for the target cluster
func NewTaskProcessor ¶
func NewTaskProcessor(ecs *ecs.ECS, s *ProcessorStats) *TaskProcessor
func (*TaskProcessor) Process ¶
func (p *TaskProcessor) Process(cluster string, taskList []*DecoratedTask) ([]*DecoratedTask, error)
func (*TaskProcessor) ProcessorName ¶
func (p *TaskProcessor) ProcessorName() string
Source Files ¶
- config.go
- containerinstanceprocessor.go
- decoratedtask.go
- dockerlabeldiscoveryprocessor.go
- processor.go
- processorstats.go
- servicediscovery.go
- servicediscoveryerror.go
- serviceendpointdiscoveryprocessor.go
- targetsexportprocessor.go
- taskdefinitiondiscoveryprocessor.go
- taskdefinitionprocessor.go
- taskfilterprocessor.go
- taskprocessor.go
Click to show internal directories.
Click to hide internal directories.