gcp – go.opentelemetry.io/contrib/detectors/gcp Index | Files

package gcp

import "go.opentelemetry.io/contrib/detectors/gcp"

Index

Functions

func NewCloudFunction

func NewCloudFunction() resource.Detector

NewCloudFunction will return a GCP Cloud Function resource detector.

Deprecated: Use gcp.NewDetector() instead, which sets the same resource attributes.

func NewDetector

func NewDetector() resource.Detector

NewDetector returns a resource detector which detects resource attributes on: * Google Compute Engine (GCE). * Google Kubernetes Engine (GKE). * Google App Engine (GAE). * Cloud Run. * Cloud Functions.

func SemVersion

func SemVersion() string

SemVersion is the semantic version to be supplied to tracer/meter creation.

Deprecated: Use Version instead.

func Version

func Version() string

Version is the current release version of the GCP resource detector.

Types

type CloudRun

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

CloudRun collects resource information of Cloud Run instance.

Deprecated: Use gcp.NewDetector() instead. Note that it sets faas.* resource attributes instead of service.* attributes.

func NewCloudRun

func NewCloudRun() *CloudRun

NewCloudRun creates a CloudRun detector.

Deprecated: Use gcp.NewDetector() instead. Note that it sets faas.* resource attributes instead of service.* attributes.

func (*CloudRun) Detect

func (c *CloudRun) Detect(ctx context.Context) (*resource.Resource, error)

Detect detects associated resources when running on Cloud Run hosts. NOTE: the service.namespace attribute is currently hardcoded to be "cloud-run-managed". This may change in the future, please do not rely on this behavior yet.

type GCE

type GCE struct{}

GCE collects resource information of GCE computing instances.

Deprecated: Use gcp.NewDetector() instead, which sets the same resource attributes on GCE.

func (*GCE) Detect

func (gce *GCE) Detect(ctx context.Context) (*resource.Resource, error)

Detect detects associated resources when running on GCE hosts.

type GKE

type GKE struct{}

GKE collects resource information of GKE computing instances.

Deprecated: Use gcp.NewDetector() instead, which does NOT detect container, pod, and namespace attributes. Set those using name using the OTEL_RESOURCE_ATTRIBUTES env var instead.

func (*GKE) Detect

func (gke *GKE) Detect(ctx context.Context) (*resource.Resource, error)

Detect detects associated resources when running in GKE environment.

Source Files

cloud-function.go cloud-run.go detector.go gce.go gke.go types.go version.go

Version
v1.35.0 (latest)
Published
Mar 6, 2025
Platform
windows/amd64
Imports
11 packages
Last checked
now

Tools for package owners.