ec2

package
v1.93.7-cluster Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SDCheckInterval = flag.Duration("promscrape.ec2SDCheckInterval", time.Minute, "Interval for checking for changes in ec2. "+
	"This works only if ec2_sd_configs is configured in '-promscrape.config' file. "+
	"See https://docs.victoriametrics.com/sd_configs.html#ec2_sd_configs for details")

SDCheckInterval defines interval for targets refresh.

Functions

This section is empty.

Types

type AvailabilityZone added in v1.64.0

type AvailabilityZone struct {
	ZoneName string `xml:"zoneName"`
	ZoneID   string `xml:"zoneId"`
}

AvailabilityZone represents availabilityZone for https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AvailabilityZone.html

type AvailabilityZoneInfo added in v1.64.0

type AvailabilityZoneInfo struct {
	Items []AvailabilityZone `xml:"item"`
}

AvailabilityZoneInfo represents availabilityZoneInfo for https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html

type AvailabilityZonesResponse added in v1.64.0

type AvailabilityZonesResponse struct {
	AvailabilityZoneInfo AvailabilityZoneInfo `xml:"availabilityZoneInfo"`
}

AvailabilityZonesResponse represents the response for https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html

type Instance

type Instance struct {
	PrivateIPAddress    string              `xml:"privateIpAddress"`
	Architecture        string              `xml:"architecture"`
	Placement           Placement           `xml:"placement"`
	ImageID             string              `xml:"imageId"`
	ID                  string              `xml:"instanceId"`
	Lifecycle           string              `xml:"instanceLifecycle"`
	State               InstanceState       `xml:"instanceState"`
	Type                string              `xml:"instanceType"`
	Platform            string              `xml:"platform"`
	SubnetID            string              `xml:"subnetId"`
	PrivateDNSName      string              `xml:"privateDnsName"`
	PublicDNSName       string              `xml:"dnsName"`
	PublicIPAddress     string              `xml:"ipAddress"`
	VPCID               string              `xml:"vpcId"`
	NetworkInterfaceSet NetworkInterfaceSet `xml:"networkInterfaceSet"`
	TagSet              TagSet              `xml:"tagSet"`
}

Instance represents Instance from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Instance.html

type InstanceSet

type InstanceSet struct {
	Items []Instance `xml:"item"`
}

InstanceSet represents InstanceSet from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Reservation.html

type InstanceState

type InstanceState struct {
	Name string `xml:"name"`
}

InstanceState represents InstanceState from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_InstanceState.html

type InstancesResponse

type InstancesResponse struct {
	ReservationSet ReservationSet `xml:"reservationSet"`
	NextPageToken  string         `xml:"nextToken"`
}

InstancesResponse represents response to https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html

type Ipv6AddressesSet added in v1.48.0

type Ipv6AddressesSet struct {
	Items []string `xml:"item"`
}

Ipv6AddressesSet represents ipv6AddressesSet from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_InstanceNetworkInterface.html

type NetworkInterface

type NetworkInterface struct {
	SubnetID         string           `xml:"subnetId"`
	IPv6AddressesSet Ipv6AddressesSet `xml:"ipv6AddressesSet"`
}

NetworkInterface represents NetworkInterface from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_InstanceNetworkInterface.html

type NetworkInterfaceSet

type NetworkInterfaceSet struct {
	Items []NetworkInterface `xml:"item"`
}

NetworkInterfaceSet represents NetworkInterfaceSet from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Instance.html

type Placement

type Placement struct {
	AvailabilityZone string `xml:"availabilityZone"`
}

Placement represents Placement from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Placement.html

type Reservation

type Reservation struct {
	OwnerID     string      `xml:"ownerId"`
	InstanceSet InstanceSet `xml:"instancesSet"`
}

Reservation represents Reservation from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Reservation.html

type ReservationSet

type ReservationSet struct {
	Items []Reservation `xml:"item"`
}

ReservationSet represetns ReservationSet from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html

type SDConfig

type SDConfig struct {
	Region      string           `yaml:"region,omitempty"`
	Endpoint    string           `yaml:"endpoint,omitempty"`
	STSEndpoint string           `yaml:"sts_endpoint,omitempty"`
	AccessKey   string           `yaml:"access_key,omitempty"`
	SecretKey   *promauth.Secret `yaml:"secret_key,omitempty"`
	// TODO add support for Profile, not working atm
	// Profile string `yaml:"profile,omitempty"`
	RoleARN string `yaml:"role_arn,omitempty"`
	// RefreshInterval time.Duration `yaml:"refresh_interval"`
	// refresh_interval is obtained from `-promscrape.ec2SDCheckInterval` command-line option.
	Port            *int            `yaml:"port,omitempty"`
	InstanceFilters []awsapi.Filter `yaml:"filters,omitempty"`
	AZFilters       []awsapi.Filter `yaml:"az_filters,omitempty"`
}

SDConfig represents service discovery config for ec2.

See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#ec2_sd_config

func (*SDConfig) GetLabels added in v1.55.0

func (sdc *SDConfig) GetLabels(_ string) ([]*promutils.Labels, error)

GetLabels returns ec2 labels according to sdc.

func (*SDConfig) MustStop added in v1.55.0

func (sdc *SDConfig) MustStop()

MustStop stops further usage for sdc.

type Tag

type Tag struct {
	Key   string `xml:"key"`
	Value string `xml:"value"`
}

Tag represents Tag from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Tag.html

type TagSet

type TagSet struct {
	Items []Tag `xml:"item"`
}

TagSet represents TagSet from https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Instance.html

Jump to

Keyboard shortcuts

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