google

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

README

Google

This package contains the Google Cloud Platform (GCP) exporter and reporter. gcp.go is responsible for setting up the GCP session and starting the collection process. The module is built upon the google-cloud-go library and uses the GCP Billing API to collect cost data. Pricing data is fetched from the [GCP Pricing API](Pricing data is fetched from the GCP Pricing API.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProjectId       string // ProjectID is where the project is running. Used for authentication.
	Region          string
	Projects        string // Projects is a comma-separated list of projects to scrape metadata from
	Services        []string
	ScrapeInterval  time.Duration
	DefaultDiscount int
	Logger          *slog.Logger
}

type GCP

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

func New

func New(config *Config) (*GCP, error)

New is responsible for parsing out a configuration file and setting up the associated services that could be required. We instantiate services to avoid repeating common services that may be shared across many collectors. In the future we can push collector specific services further down.

func (*GCP) CheckReadiness added in v0.3.0

func (g *GCP) CheckReadiness() bool

func (*GCP) Collect

func (g *GCP) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface and will iterate over all the collectors instantiated during New and collect their metrics.

func (*GCP) Describe

func (g *GCP) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface and will iterate over all the collectors instantiated during New and describe their metrics.

func (*GCP) RegisterCollectors

func (g *GCP) RegisterCollectors(registry provider.Registry) error

RegisterCollectors will iterate over all the collectors instantiated during New and register their metrics.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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