Documentation ¶
Index ¶
- Constants
- func ListDisks(project string, zone string, service *compute.Service) ([]*compute.Disk, error)
- type Collector
- func (c *Collector) CheckReadiness() bool
- func (c *Collector) Collect(ch chan<- prometheus.Metric) error
- func (c *Collector) CollectMetrics(ch chan<- prometheus.Metric) float64
- func (c *Collector) Describe(ch chan<- *prometheus.Desc) error
- func (c *Collector) Name() string
- func (c *Collector) Register(_ provider.Registry) error
- type Config
- type Disk
Constants ¶
const (
BootDiskLabel = "goog-gke-node"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collector ¶
type Collector struct { Projects []string ComputePricingMap *gcpCompute.StructuredPricingMap NextScrape time.Time // contains filtered or unexported fields }
func New ¶
func New(config *Config, computeService *compute.Service, billingService *billingv1.CloudCatalogClient) *Collector
func (*Collector) CheckReadiness ¶ added in v0.3.0
func (*Collector) CollectMetrics ¶
func (c *Collector) CollectMetrics(ch chan<- prometheus.Metric) float64
type Disk ¶
type Disk struct { Cluster string Project string Size int64 // contains filtered or unexported fields }
func (Disk) DiskType ¶
DiskType will search through the labels to determine the type of disk. If the disk has a label "goog-gke-node" it will return "boot_disk" Otherwise it returns persistent_volume
func (Disk) Name ¶
Name will return the name of the disk. If the disk has a label "kubernetes.io/created-for/pv/name" it will return the value stored in that key. otherwise it will return the disk name that is directly associated with the disk.
func (Disk) Namespace ¶
Namespace will search through the description fields for the namespace of the disk. If the namespace can't be determined An empty string is return.
func (Disk) Region ¶
Region will return the region of the disk by search through the zone field and returning the region. If the region can't be determined It will return an empty string
func (Disk) StorageClass ¶
StorageClass will return the storage class of the disk by looking at the type. Type in GCP is represented as a URL and as such we're looking for the last part of the URL to determine the storage class