package gcp
import "github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp"
Index ¶
- type Detector
- func NewDetector() *Detector
- func (d *Detector) AppEngineFlexAvailabilityZoneAndRegion() (string, string, error)
- func (d *Detector) AppEngineServiceInstance() (string, error)
- func (d *Detector) AppEngineServiceName() (string, error)
- func (d *Detector) AppEngineServiceVersion() (string, error)
- func (d *Detector) AppEngineStandardAvailabilityZone() (string, error)
- func (d *Detector) AppEngineStandardCloudRegion() (string, error)
- func (d *Detector) BareMetalSolutionCloudRegion() (string, error)
- func (d *Detector) BareMetalSolutionInstanceID() (string, error)
- func (d *Detector) BareMetalSolutionProjectID() (string, error)
- func (d *Detector) CloudPlatform() Platform
- func (d *Detector) CloudRunJobExecution() (string, error)
- func (d *Detector) CloudRunJobTaskIndex() (string, error)
- func (d *Detector) FaaSCloudRegion() (string, error)
- func (d *Detector) FaaSID() (string, error)
- func (d *Detector) FaaSName() (string, error)
- func (d *Detector) FaaSVersion() (string, error)
- func (d *Detector) GCEAvailabilityZoneAndRegion() (string, string, error)
- func (d *Detector) GCEHostID() (string, error)
- func (d *Detector) GCEHostName() (string, error)
- func (d *Detector) GCEHostType() (string, error)
- func (d *Detector) GCEInstanceHostname() (string, error)
- func (d *Detector) GCEInstanceName() (string, error)
- func (d *Detector) GCEManagedInstanceGroup() (ManagedInstanceGroup, error)
- func (d *Detector) GKEAvailabilityZoneOrRegion() (string, LocationType, error)
- func (d *Detector) GKEClusterName() (string, error)
- func (d *Detector) GKEHostID() (string, error)
- func (d *Detector) ProjectID() (string, error)
- type LocationType
- type ManagedInstanceGroup
- type Platform
Types ¶
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector collects resource information for all GCP platforms.
func NewDetector ¶
func NewDetector() *Detector
NewDetector returns a *Detector which can get detect the platform, and fetch attributes of the platform on which it is running.
func (*Detector) AppEngineFlexAvailabilityZoneAndRegion ¶
AppEngineFlexAvailabilityZoneAndRegion returns the zone and region in which this program is running.
func (*Detector) AppEngineServiceInstance ¶
AppEngineServiceInstance returns the service instance of the app engine service.
func (*Detector) AppEngineServiceName ¶
AppEngineServiceName returns the service name of the app engine service.
func (*Detector) AppEngineServiceVersion ¶
AppEngineServiceVersion returns the service version of the app engine service.
func (*Detector) AppEngineStandardAvailabilityZone ¶
AppEngineStandardAvailabilityZone returns the zone the app engine service is running in.
func (*Detector) AppEngineStandardCloudRegion ¶
AppEngineStandardCloudRegion returns the region the app engine service is running in.
func (*Detector) BareMetalSolutionCloudRegion ¶
BareMetalSolutionCloudRegion returns the region from the BMS_REGION environment variable.
func (*Detector) BareMetalSolutionInstanceID ¶
BareMetalSolutionInstanceID returns the instance ID from the BMS_INSTANCE_ID environment variable.
func (*Detector) BareMetalSolutionProjectID ¶
BareMetalSolutionProjectID returns the project ID from the BMS_PROJECT_ID environment variable.
func (*Detector) CloudPlatform ¶
CloudPlatform returns the platform on which this program is running.
func (*Detector) CloudRunJobExecution ¶
CloudRunJobExecution returns the execution id of the Cloud Run jobs.
func (*Detector) CloudRunJobTaskIndex ¶
CloudRunJobTaskIndex returns the task index for the execution of the Cloud Run jobs.
func (*Detector) FaaSCloudRegion ¶
FaaSCloudRegion detects region from the metadata server. It is in the format /projects/<project_number>/regions/<region>.
https://cloud.google.com/run/docs/reference/container-contract#metadata-server
func (*Detector) FaaSID ¶
FaaSID returns the instance id of the Cloud Run or Cloud Function.
func (*Detector) FaaSName ¶
FaaSName returns the name of the Cloud Run, Cloud Run jobs or Cloud Functions service.
func (*Detector) FaaSVersion ¶
FaaSVersion returns the revision of the Cloud Run or Cloud Functions service.
func (*Detector) GCEAvailabilityZoneAndRegion ¶
GCEAvailabilityZoneAndRegion returns the zone and region in which this program is running.
func (*Detector) GCEHostID ¶
GCEHostID returns the instance ID of the instance on which this program is running.
func (*Detector) GCEHostName ¶
GCEHostName returns the instance name of the instance on which this program is running. Recommended to use GCEInstanceName() or GCEInstanceHostname() to more accurately reflect which value is returned.
func (*Detector) GCEHostType ¶
GCEHostType returns the machine type of the instance on which this program is running.
func (*Detector) GCEInstanceHostname ¶
GCEInstanceHostname returns the full value of the default or custom hostname of the instance on which this program is running. See https://cloud.google.com/compute/docs/instances/custom-hostname-vm.
func (*Detector) GCEInstanceName ¶
GCEInstanceName returns the instance name of the instance on which this program is running. This is the value visible in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the default internal DNS name (see https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
func (*Detector) GCEManagedInstanceGroup ¶
func (d *Detector) GCEManagedInstanceGroup() (ManagedInstanceGroup, error)
func (*Detector) GKEAvailabilityZoneOrRegion ¶
func (d *Detector) GKEAvailabilityZoneOrRegion() (string, LocationType, error)
GKEAvailabilityZoneOrRegion returns the location of the cluster and whether the cluster is zonal or regional.
func (*Detector) GKEClusterName ¶
GKEClusterName returns the name if the GKE cluster in which this program is running.
func (*Detector) GKEHostID ¶
GKEHostID returns the instance ID of the instance on which this program is running.
func (*Detector) ProjectID ¶
ProjectID returns the ID of the project in which this program is running.
type LocationType ¶
type LocationType int64
const ( UndefinedLocation LocationType = iota Zone Region )
type ManagedInstanceGroup ¶
type ManagedInstanceGroup struct { Name string Location string Type LocationType }
type Platform ¶
type Platform int64
const ( UnknownPlatform Platform = iota GKE GCE CloudRun CloudRunJob CloudFunctions AppEngineStandard AppEngineFlex BareMetalSolution )
Source Files ¶
app_engine.go bms.go detector.go faas.go gce.go gke.go
- Version
- v1.27.0 (latest)
- Published
- Feb 26, 2025
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 15 hours ago –
Tools for package owners.