Documentation ¶
Index ¶
- func MetadataV3BaseURL() (*url.URL, error)
- func MetadataV4BaseURL() (*url.URL, error)
- func TaskMetadataEndpoint(baseURL string) string
- func TaskStatsEndpoint(baseURL string) string
- type ContainerResponse
- type FargateFetcher
- type FargateInspector
- type FargateStats
- type HealthStatus
- type LimitsResponse
- type Network
- type PortResponse
- type TaskResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MetadataV3BaseURL ¶
MetadataV3BaseURL returns the v3 metadata endpoint configured via the ECS_CONTAINER_METADATA_URI environment variable.
func MetadataV4BaseURL ¶ added in v1.5.0
MetadataV4BaseURL returns the v4 metadata endpoint configured via the ECS_CONTAINER_METADATA_URI environment variable.
func TaskMetadataEndpoint ¶
TaskMetadataEndpoint returns the V3 endpoint to fetch task metadata given a base URL.
func TaskStatsEndpoint ¶
TaskStatsEndpoint returns the V3 endpoint to fetch task stats given a base URL.
Types ¶
type ContainerResponse ¶
type ContainerResponse struct { ID string `json:"DockerId"` Name string `json:"Name"` DockerName string `json:"DockerName"` Image string `json:"Image"` ImageID string `json:"ImageID"` Ports []PortResponse `json:"Ports,omitempty"` Labels map[string]string `json:"Labels,omitempty"` DesiredStatus string `json:"DesiredStatus"` KnownStatus string `json:"KnownStatus"` ExitCode *int `json:"ExitCode,omitempty"` Limits LimitsResponse `json:"Limits"` CreatedAt *time.Time `json:"CreatedAt,omitempty"` StartedAt *time.Time `json:"StartedAt,omitempty"` FinishedAt *time.Time `json:"FinishedAt,omitempty"` Type string `json:"Type"` Networks []Network `json:"Networks,omitempty"` Health HealthStatus `json:"Health,omitempty"` }
ContainerResponse defines the schema for the container response JSON object
type FargateFetcher ¶
type FargateFetcher struct {
// contains filtered or unexported fields
}
FargateFetcher fetches metrics from Fargate endpoints in AWS ECS.
func NewFargateFetcher ¶
func NewFargateFetcher(baseURL *url.URL) (*FargateFetcher, error)
NewFargateFetcher creates a new FargateFetcher with the given HTTP client.
func (*FargateFetcher) Fetch ¶
func (e *FargateFetcher) Fetch(container docker.ContainerJSON) (raw.Metrics, error)
Fetch fetches raw metrics from a given Fargate container.
type FargateInspector ¶
type FargateInspector struct {
// contains filtered or unexported fields
}
FargateInspector is responsible for listing containers and inspecting containers in Fargate. Both operations use the same data source and thus access it through a caching layer to avoid extra computations.
func NewFargateInspector ¶
func NewFargateInspector(baseURL *url.URL) (*FargateInspector, error)
NewFargateInspector creates a new FargateInspector
func (*FargateInspector) ContainerInspect ¶
func (i *FargateInspector) ContainerInspect(_ context.Context, containerID string) (types.ContainerJSON, error)
ContainerInspect returns metadata about a container given its container ID.
func (*FargateInspector) ContainerList ¶
func (i *FargateInspector) ContainerList(_ context.Context, _ types.ContainerListOptions) ([]types.Container, error)
ContainerList lists containers that the current Fargate container can see (only the container in the same task). It completely ignores any listing option for the moment.
type FargateStats ¶
type FargateStats map[string]*timedDockerStats
FargateStats holds a map of Fargate container IDs as key and their Docker metrics as values.
type HealthStatus ¶
type HealthStatus struct { Status string `json:"status,omitempty"` Since *time.Time `json:"statusSince,omitempty"` ExitCode int `json:"exitCode,omitempty"` Output string `json:"output,omitempty"` }
HealthStatus represents a container's health.
type LimitsResponse ¶
type LimitsResponse struct { CPU *float64 `json:"CPU,omitempty"` Memory *int64 `json:"Memory,omitempty"` }
LimitsResponse defines the schema for task/cpu limits response JSON object
type Network ¶
type Network struct { NetworkMode string `json:"NetworkMode,omitempty"` IPv4Addresses []string `json:"IPv4Addresses,omitempty"` IPv6Addresses []string `json:"IPv6Addresses,omitempty"` }
Network is a struct that keeps track of metadata of a network interface
type PortResponse ¶
type PortResponse struct { ContainerPort uint16 `json:"ContainerPort,omitempty"` Protocol string `json:"Protocol,omitempty"` HostPort uint16 `json:"HostPort,omitempty"` }
PortResponse defines the schema for portmapping response JSON object.
type TaskResponse ¶
type TaskResponse struct { Cluster string `json:"Cluster"` TaskARN string `json:"TaskARN"` Family string `json:"Family"` Revision string `json:"Revision"` DesiredStatus string `json:"DesiredStatus,omitempty"` KnownStatus string `json:"KnownStatus"` AvailabilityZone string `json:"AvailabilityZone"` Containers []ContainerResponse `json:"Containers,omitempty"` Limits *LimitsResponse `json:"Limits,omitempty"` PullStartedAt *time.Time `json:"PullStartedAt,omitempty"` PullStoppedAt *time.Time `json:"PullStoppedAt,omitempty"` ExecutionStoppedAt *time.Time `json:"ExecutionStoppedAt,omitempty"` }
TaskResponse defines the schema for the task response JSON object