package gcp

import "contrib.go.opencensus.io/exporter/stackdriver/monitoredresource/gcp"

Index

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

Source Files

gcp_metadata_config.go monitored_resources.go

Version
v0.13.14 (latest)
Published
Sep 14, 2022
Platform
linux/amd64
Imports
5 packages
Last checked
3 weeks ago

Tools for package owners.