class documentation

class GoogleCloudRunMetadata: (source)

View In Hierarchy

Identifying metadata for the current Google Cloud Run instance.

Both Cloud Run worker pools and services are supported. Worker pools expose CLOUD_RUN_WORKER_POOL and CLOUD_RUN_REVISION; services expose K_SERVICE and K_REVISION.

Instance Variable instance_id Unique id of this Cloud Run container instance, read from the Cloud Run metadata server.
Instance Variable name The Cloud Run worker pool name (CLOUD_RUN_WORKER_POOL) or, for a service, the service name (K_SERVICE). May be empty when the process is not running on Cloud Run.
Instance Variable revision Cloud Run revision name (CLOUD_RUN_REVISION for worker pools or K_REVISION for services). May be empty when the process is not running on Cloud Run.
Property identity Worker identity string uniquely identifying this Cloud Run instance.
instance_id: str = (source)

Unique id of this Cloud Run container instance, read from the Cloud Run metadata server.

The Cloud Run worker pool name (CLOUD_RUN_WORKER_POOL) or, for a service, the service name (K_SERVICE). May be empty when the process is not running on Cloud Run.

revision: str = (source)

Cloud Run revision name (CLOUD_RUN_REVISION for worker pools or K_REVISION for services). May be empty when the process is not running on Cloud Run.

Worker identity string uniquely identifying this Cloud Run instance.

The format is <instance_id>@<revision>. When the revision is empty the worker pool or service name is used instead (<instance_id>@<name>); when both are empty the instance id is returned on its own.