ec2

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClientNotFound = errors.New("no client found")

	ErrGeneratePricingMap = errors.New("error generating pricing map")
)

Functions

This section is empty.

Types

type Collector

type Collector struct {
	Region         string
	Regions        []ec2Types.Region
	Profile        string
	Profiles       []string
	ScrapeInterval time.Duration

	NextScrape time.Time
	// contains filtered or unexported fields
}

Collector is a prometheus collector that collects metrics from AWS EKS clusters.

func New

func New(ctx context.Context, config *Config, ps pricingClient.Pricing, ec2s ec2client.EC2, regionClientMap map[string]ec2client.EC2) *Collector

New creates an AWS EC2 collector.

func (*Collector) Collect

func (c *Collector) Collect(_ chan<- prometheus.Metric) error

Collect satisfies the provider.Collector interface.

func (*Collector) CollectMetrics

func (c *Collector) CollectMetrics(_ chan<- prometheus.Metric) float64

CollectMetrics is a no-op function that satisfies the provider.Collector interface. Deprecated: CollectMetrics is deprecated and will be removed in a future release.

func (*Collector) Describe

func (c *Collector) Describe(_ chan<- *prometheus.Desc) error

func (*Collector) Name

func (c *Collector) Name() string

func (*Collector) Register

func (c *Collector) Register(_ provider.Registry) error

Register is called by the prometheus library to register any static metrics that require persistence.

type Config

type Config struct {
	Regions []ec2Types.Region
	Logger  *slog.Logger
}

Jump to

Keyboard shortcuts

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