cloudsql

package
v0.32.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CostRefreshInterval = 24 * time.Hour
)

Variables

View Source
var (
	ErrInstanceNotFound   = errors.New("instance not found")
	ErrPriceNotFound      = errors.New("price not found for instance")
	ErrInvalidTier        = errors.New("invalid tier format")
	ErrRegionNotFound     = errors.New("region not found in pricing")
	ErrCustomPriceMissing = errors.New("custom pricing (CPU/RAM) not available")
)
View Source
var (
	HourlyGaugeDesc = utils.GenerateDesc(
		cloudcost_exporter.MetricPrefix,
		subsystem,
		"cost_usd_per_hour",
		"Hourly cost of GCP cloudsql instances by instance name and region. Cost represented in USD/hour",
		[]string{"instance", "region"},
	)
)

Functions

This section is empty.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, config *Config, gcpClient client.Client) (*Collector, error)

func (*Collector) Collect

func (c *Collector) Collect(ctx context.Context, ch chan<- prometheus.Metric) error

func (*Collector) Describe

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

func (*Collector) Name

func (c *Collector) Name() string

func (*Collector) Regions added in v0.28.1

func (c *Collector) Regions() []string

func (*Collector) Register

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

type Config

type Config struct {
	Projects       string
	ScrapeInterval time.Duration
	Logger         *slog.Logger
}

Jump to

Keyboard shortcuts

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