Documentation
¶
Index ¶
- Constants
- Variables
- type Collector
- type Config
- type VPCGlobalPricing
- type VPCPricingMap
- func (pm *VPCPricingMap) GetCloudNATDataProcessingRate(region string) (float64, error)
- func (pm *VPCPricingMap) GetCloudNATGatewayHourlyRate(region string) (float64, error)
- func (pm *VPCPricingMap) GetPrivateServiceConnectDataProcessingRate(region string) (float64, error)
- func (pm *VPCPricingMap) GetPrivateServiceConnectEndpointRates(region string) (map[string]float64, error)
- func (pm *VPCPricingMap) GetRegionPricing(region string) (*VPCRegionPricing, error)
- func (pm *VPCPricingMap) GetVPNGatewayHourlyRate(region string) (float64, error)
- func (pm *VPCPricingMap) Refresh(ctx context.Context) error
- type VPCRegionPricing
Constants ¶
const ( // Main service patterns CloudNATPattern = "cloud nat" NATPattern = "nat" VPNGatewayPattern = "Cloud VPN" VPNUsageType = "VPN" PrivateServiceConnectPattern = "private service connect" // Sub-patterns for categorization DataProcessingPattern = "data processing" DataProcessedPattern = "data processed" GatewayPattern = "gateway" UptimePattern = "uptime" // PSC endpoint type patterns PartnerPattern = "partner" ConsumerPattern = "consumer" RegionalPattern = "regional" APIPattern = "api" InterfacesPattern = "interfaces" GKEPattern = "gke" GoogleManagedPattern = "google managed" )
const PriceRefreshInterval = 24 * time.Hour
Variables ¶
var ( CloudNATGatewayHourlyGaugeDesc = utils.GenerateDesc( cloudcostexporter.MetricPrefix, subsystem, "nat_gateway_hourly_rate_usd_per_hour", "Hourly cost of Cloud NAT Gateway by region and project. Cost represented in USD/hour", []string{"region", "project"}, ) CloudNATDataProcessingGaugeDesc = utils.GenerateDesc( cloudcostexporter.MetricPrefix, subsystem, "nat_gateway_data_processing_usd_per_gb", "Data processing cost of Cloud NAT Gateway by region and project. Cost represented in USD/GB", []string{"region", "project"}, ) VPNGatewayHourlyGaugeDesc = utils.GenerateDesc( cloudcostexporter.MetricPrefix, subsystem, "vpn_gateway_hourly_rate_usd_per_hour", "Hourly cost of VPN Gateway by region and project. Cost represented in USD/hour", []string{"region", "project"}, ) PrivateServiceConnectEndpointHourlyGaugeDesc = utils.GenerateDesc( cloudcostexporter.MetricPrefix, subsystem, "private_service_connect_endpoint_hourly_rate_usd_per_hour", "Hourly cost of Private Service Connect endpoints by region, project, and type. Cost represented in USD/hour", []string{"region", "project", "endpoint_type"}, ) PrivateServiceConnectDataProcessingGaugeDesc = utils.GenerateDesc( cloudcostexporter.MetricPrefix, subsystem, "private_service_connect_data_processing_usd_per_gb", "Data processing cost of Private Service Connect by region and project. Cost represented in USD/GB", []string{"region", "project"}, ) )
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector implements provider.Collector for GCP VPC metrics
type VPCGlobalPricing ¶
type VPCGlobalPricing struct {
CloudNATGatewayRates map[string]float64
CloudNATDataProcessingRates map[string]float64
PrivateServiceConnectEndpointRates map[string]map[string]float64
PrivateServiceConnectDataProcessingRates map[string]float64
}
VPCGlobalPricing holds global pricing that applies to all regions
func NewVPCGlobalPricing ¶
func NewVPCGlobalPricing() *VPCGlobalPricing
NewVPCGlobalPricing creates a new VPCGlobalPricing instance
type VPCPricingMap ¶
type VPCPricingMap struct {
// contains filtered or unexported fields
}
VPCPricingMap manages pricing data for all GCP VPC services across regions
func NewVPCPricingMap ¶
func NewVPCPricingMap(logger *slog.Logger, gcpClient client.Client) *VPCPricingMap
NewVPCPricingMap creates a new VPCPricingMap instance
func (*VPCPricingMap) GetCloudNATDataProcessingRate ¶
func (pm *VPCPricingMap) GetCloudNATDataProcessingRate(region string) (float64, error)
GetCloudNATDataProcessingRate returns the data processing rate for Cloud NAT in the specified region
func (*VPCPricingMap) GetCloudNATGatewayHourlyRate ¶
func (pm *VPCPricingMap) GetCloudNATGatewayHourlyRate(region string) (float64, error)
GetCloudNATGatewayHourlyRate returns the hourly rate for Cloud NAT Gateway in the specified region
func (*VPCPricingMap) GetPrivateServiceConnectDataProcessingRate ¶
func (pm *VPCPricingMap) GetPrivateServiceConnectDataProcessingRate(region string) (float64, error)
GetPrivateServiceConnectDataProcessingRate returns the data processing rate for Private Service Connect
func (*VPCPricingMap) GetPrivateServiceConnectEndpointRates ¶
func (pm *VPCPricingMap) GetPrivateServiceConnectEndpointRates(region string) (map[string]float64, error)
GetPrivateServiceConnectEndpointRates returns endpoint rates by type for the specified region
func (*VPCPricingMap) GetRegionPricing ¶
func (pm *VPCPricingMap) GetRegionPricing(region string) (*VPCRegionPricing, error)
GetRegionPricing returns pricing data for a specific region
func (*VPCPricingMap) GetVPNGatewayHourlyRate ¶
func (pm *VPCPricingMap) GetVPNGatewayHourlyRate(region string) (float64, error)
GetVPNGatewayHourlyRate returns the hourly rate for VPN Gateway in the specified region
type VPCRegionPricing ¶
type VPCRegionPricing struct {
CloudNATGatewayRates map[string]float64
CloudNATDataProcessingRates map[string]float64
VPNGatewayRates map[string]float64
PrivateServiceConnectEndpointRates map[string]map[string]float64
PrivateServiceConnectDataProcessingRates map[string]float64
}
VPCRegionPricing holds pricing data for all VPC services in a specific region
func NewVPCRegionPricing ¶
func NewVPCRegionPricing() *VPCRegionPricing
NewVPCRegionPricing creates a new VPCRegionPricing instance