Documentation ¶
Index ¶
Constants ¶
View Source
const ( // KeyEnabled toggles whether the GCP module is active or not. KeyEnabled = "gcp.enabled" // DefaultEnabled defines the default setting. DefaultEnabled = false // KeyConfDir defines the gcp configuration directory. KeyConfDir = "gcp.conf_dir" // KeyConfExample shows an example configuration. KeyConfExample = "gcp.config_example" )
Variables ¶
View Source
var ( // DefaultConfDir is the default location of gcp configuration files. DefaultConfDir = path.Join(defaults.EtcPath, "gcp.d") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ID string `json:"id" toml:"id" yaml:"id"` // unique id for this service client instance, no spaces (ties several things together, short and immutable - logging, check search/create, tags, etc.) Circonus circonus.ServiceConfig `json:"circonus" toml:"circonus" yaml:"circonus"` // REQUIRED circonus config: api credentials, check, broker, etc. Tags circonus.Tags `json:"tags" toml:"tags" yaml:"tags"` // global tags, added to all metrics GCP GCPConfig `json:"gcp" toml:"gcp" yaml:"gcp"` // REQUIRED gcp configuration }
Config defines the options for a gcp service instance.
type GCPConfig ¶
type GCPConfig struct { Collectors []collectors.GCPCollector `json:"services" toml:"services" yaml:"services"` // which services to collectc metrics for in this region CredentialsFile string `json:"credentials_file" toml:"credentials_file" yaml:"credentials_file"` // REQUIRED gcp service account credentials file (if it does not begin with filepath.Separator, the default etc path - relative to where circonus-cloud-agentd is running - will be used, allowing relative paths) Interval int `json:"collect_interval" toml:"collect_interval" yaml:"collect_interval"` // DEFAULT: 5 - How often to collect metrics.(minutes >= 5) // contains filtered or unexported fields }
GCPConfig holds the gcp specific configuration options.
type GCPService ¶
type GCPService struct {
// contains filtered or unexported fields
}
GCPService defines the GCP cloud service client.
func New ¶
func New(ctx context.Context) (*GCPService, error)
New returns a GCP metric collector service.
func (*GCPService) Enabled ¶
func (svc *GCPService) Enabled() bool
Enabled indicates whether the GCP service is enabled.
func (*GCPService) Scan ¶
func (svc *GCPService) Scan() error
Scan checks the service config directory for configurations and loads them.
func (*GCPService) Start ¶
func (svc *GCPService) Start() error
Start begins collecting metrics from GCP.
Click to show internal directories.
Click to hide internal directories.