gcp

package
v0.0.0-...-b628ab9 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCEInstance

type GCEInstance struct {

	// ProjectID is the identifier of the GCP project associated with this resource, such as "my-project".
	ProjectID string

	// InstanceID is the numeric VM instance identifier assigned by Compute Engine.
	InstanceID string

	// Zone is the Compute Engine zone in which the VM is running.
	Zone string
}

GCEInstance represents gce_instance type monitored resource. For definition refer to https://cloud.google.com/monitoring/api/resources#tag_gce_instance

func (*GCEInstance) MonitoredResource

func (gce *GCEInstance) MonitoredResource() (resType string, labels map[string]string)

MonitoredResource returns resource type and resource labels for GCEInstance

type GKEContainer

type GKEContainer struct {

	// ProjectID is the identifier of the GCP project associated with this resource, such as "my-project".
	ProjectID string

	// InstanceID is the numeric VM instance identifier assigned by Compute Engine.
	InstanceID string

	// ClusterName is the name for the cluster the container is running in.
	ClusterName string

	// ContainerName is the name of the container.
	ContainerName string

	// NamespaceID is the identifier for the cluster namespace the container is running in
	NamespaceID string

	// PodID is the identifier for the pod the container is running in.
	PodID string

	// Zone is the Compute Engine zone in which the VM is running.
	Zone string

	// LoggingMonitoringV2Enabled is the identifier if user enabled V2 logging and monitoring for GKE
	LoggingMonitoringV2Enabled bool
}

GKEContainer represents gke_container type monitored resource. For definition refer to https://cloud.google.com/monitoring/api/resources#tag_gke_container

func (*GKEContainer) MonitoredResource

func (gke *GKEContainer) MonitoredResource() (resType string, labels map[string]string)

MonitoredResource returns resource type and resource labels for GKEContainer

type Interface

type Interface interface {

	// MonitoredResource returns the resource type and resource labels.
	MonitoredResource() (resType string, labels map[string]string)
}

Interface is a type that represent monitor resource that satisfies monitoredresource.Interface

func Autodetect

func Autodetect() Interface

Autodetect auto detects monitored resources based on the environment where the application is running. It supports detection of following resource types 1. gke_container: 2. gce_instance:

Returns MonitoredResInterface which implements getLabels() and getType() For resource definition go to https://cloud.google.com/monitoring/api/resources

Jump to

Keyboard shortcuts

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