networking

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	ForwardingRuleUnitCostDesc = prometheus.NewDesc(
		prometheus.BuildFQName(cloudcostexporter.MetricPrefix, subsystem, fwdRuleMetricName),
		fwdRuleDescription,
		[]string{"name", "region", "project", "ip_address", "load_balancing_scheme"},
		nil,
	)
	ForwardingRuleInboundDataProcessedCostDesc = prometheus.NewDesc(
		prometheus.BuildFQName(cloudcostexporter.MetricPrefix, subsystem, fwdRuleInboundDataMetricName),
		fwdRuleInboundDataDescription,
		[]string{"name", "region", "project", "ip_address", "load_balancing_scheme"}, nil,
	)
	ForwardingRuleOutboundDataProcessedCostDesc = prometheus.NewDesc(
		prometheus.BuildFQName(cloudcostexporter.MetricPrefix, subsystem, fwdRuleOutboundDataMetricName),
		fwdRuleOutboundDataDescription,
		[]string{"name", "region", "project", "ip_address", "load_balancing_scheme"}, nil,
	)
)
View Source
var (
	ResourceGroup = "LoadBalancing"

	ErrRefreshingPricingMap            = errors.New("error refreshing pricing map")
	ErrGettingNetworkingServiceName    = errors.New("error getting networking service name")
	ErrNoSKUsFoundForNetworkingService = errors.New("no skus found for networking service")
	ErrParsingSKUs                     = errors.New("error parsing skus")
	ErrRegionNotFound                  = errors.New("region not found")
	ErrUnknownDescription              = errors.New("unknown description")
)

Functions

func NewPricing

func NewPricing() *pricing

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) CollectMetrics

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

func (*Collector) Describe

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

func (*Collector) Name

func (c *Collector) Name() string

func (*Collector) Register

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

type Config

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

type ForwardingRuleInfo

type ForwardingRuleInfo struct {
	Name                      string
	Region                    string
	Project                   string
	IPAddress                 string
	LoadBalancingScheme       string
	ForwardingRuleCost        float64
	InboundDataProcessedCost  float64
	OutboundDataProcessedCost float64
}

type ParsedSkuData

type ParsedSkuData struct {
	Region      string
	Price       float64
	Description string
}

func NewParsedSkuData

func NewParsedSkuData(region string, price float64, description string) *ParsedSkuData

Jump to

Keyboard shortcuts

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