stackdriver: contrib.go.opencensus.io/exporter/stackdriver/monitoredresource/gcp Index | Files

package gcp

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

Index

Package Files

gcp_metadata_config.go monitored_resources.go

type GCEInstance Uses

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 Uses

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

MonitoredResource returns resource type and resource labels for GCEInstance

type GKEContainer Uses

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 Uses

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

MonitoredResource returns resource type and resource labels for GKEContainer

type Interface Uses

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 Uses

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

Package gcp imports 9 packages (graph) and is imported by 3 packages. Updated 2020-02-20. Refresh now. Tools for package owners.