Documentation ¶
Index ¶
- Variables
- type AssumeRoleResponse
- type AvailabilityZone
- type AvailabilityZoneInfo
- type AvailabilityZonesResponse
- type Filter
- type IdentityDocument
- type Instance
- type InstanceSet
- type InstanceState
- type InstancesResponse
- type Ipv6AddressesSet
- type MetadataSecurityCredentials
- type NetworkInterface
- type NetworkInterfaceSet
- type Placement
- type Reservation
- type ReservationSet
- type SDConfig
- type Tag
- type TagSet
Constants ¶
This section is empty.
Variables ¶
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://prometheus.io/docs/prometheus/latest/configuration/configuration/#ec2_sd_config for details")
SDCheckInterval defines interval for targets refresh.
Functions ¶
This section is empty.
Types ¶
type AssumeRoleResponse ¶ added in v1.41.1
type AssumeRoleResponse struct { AssumeRoleResult struct { Credentials assumeCredentials } AssumeRoleWithWebIdentityResult struct { Credentials assumeCredentials } }
AssumeRoleResponse represents AssumeRole response
See https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html
type AvailabilityZone ¶ added in v1.64.0
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 Filter ¶
Filter is ec2 filter.
See https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html and https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Filter.html
type IdentityDocument ¶
type IdentityDocument struct {
Region string
}
IdentityDocument is identity document returned from AWS metadata server.
See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.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 MetadataSecurityCredentials ¶ added in v1.41.1
type MetadataSecurityCredentials struct { AccessKeyID string `json:"AccessKeyId"` SecretAccessKey string `json:"SecretAccessKey"` Token string `json:"Token"` Expiration time.Time `json:"Expiration"` }
MetadataSecurityCredentials represents credentials obtained from http://169.254.169.254/latest/meta-data/iam/security-credentials/*
See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.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"` AccessKey string `yaml:"access_key,omitempty"` SecretKey string `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"` Filters []Filter `yaml:"filters,omitempty"` }
SDConfig represents service discovery config for ec2.
See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#ec2_sd_config
type Tag ¶
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