Reference documentation and code samples for the Google Cloud Profiler V2 Client class Deployment.
Deployment contains the deployment identification information.
Generated from protobuf message google.devtools.cloudprofiler.v2.Deployment
Namespace
Google \ Cloud \ Profiler \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ project_id
string
Project ID is the ID of a cloud project. Validation regex: ^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$.
↳ target
string
Target is the service name used to group related deployments: * * Service name for App Engine Flex / Standard. * * Cluster and container name for GKE. * * User-specified string for direct Compute Engine profiling (e.g. Java). * * Job name for Dataflow. Validation regex: ^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$.
Labels identify the deployment within the user universe and same target. Validation regex for label names: ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$. Value for an individual label must be <= 512 bytes, the total size of all label names and values must be <= 1024 bytes. Label named "language" can be used to record the programming language of the profiled deployment. The standard choices for the value include "java", "go", "python", "ruby", "nodejs", "php", "dotnet". For deployments running on Google Cloud Platform, "zone" or "region" label should be present describing the deployment location. An example of a zone is "us-central1-a", an example of a region is "us-central1" or "us-central".
Target is the service name used to group related deployments:
Service name for App Engine Flex / Standard.
Cluster and container name for GKE.
User-specified string for direct Compute Engine profiling (e.g. Java).
Job name for Dataflow.
Validation regex: ^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$.
Returns
Type
Description
string
setTarget
Target is the service name used to group related deployments:
Service name for App Engine Flex / Standard.
Cluster and container name for GKE.
User-specified string for direct Compute Engine profiling (e.g. Java).
Job name for Dataflow.
Validation regex: ^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getLabels
Labels identify the deployment within the user universe and same target.
Validation regex for label names: ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$.
Value for an individual label must be <= 512 bytes, the total
size of all label names and values must be <= 1024 bytes.
Label named "language" can be used to record the programming language of
the profiled deployment. The standard choices for the value include "java",
"go", "python", "ruby", "nodejs", "php", "dotnet".
For deployments running on Google Cloud Platform, "zone" or "region" label
should be present describing the deployment location. An example of a zone
is "us-central1-a", an example of a region is "us-central1" or
"us-central".
Labels identify the deployment within the user universe and same target.
Validation regex for label names: ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$.
Value for an individual label must be <= 512 bytes, the total
size of all label names and values must be <= 1024 bytes.
Label named "language" can be used to record the programming language of
the profiled deployment. The standard choices for the value include "java",
"go", "python", "ruby", "nodejs", "php", "dotnet".
For deployments running on Google Cloud Platform, "zone" or "region" label
should be present describing the deployment location. An example of a zone
is "us-central1-a", an example of a region is "us-central1" or
"us-central".
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Profiler V2 Client - Class Deployment (2.0.4)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.4 (latest)](/php/docs/reference/cloud-profiler/latest/V2.Deployment)\n- [2.0.3](/php/docs/reference/cloud-profiler/2.0.3/V2.Deployment)\n- [1.4.3](/php/docs/reference/cloud-profiler/1.4.3/V2.Deployment)\n- [1.3.0](/php/docs/reference/cloud-profiler/1.3.0/V2.Deployment)\n- [1.2.4](/php/docs/reference/cloud-profiler/1.2.4/V2.Deployment)\n- [1.1.1](/php/docs/reference/cloud-profiler/1.1.1/V2.Deployment)\n- [1.0.3](/php/docs/reference/cloud-profiler/1.0.3/V2.Deployment) \nReference documentation and code samples for the Google Cloud Profiler V2 Client class Deployment.\n\nDeployment contains the deployment identification information.\n\nGenerated from protobuf message `google.devtools.cloudprofiler.v2.Deployment`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Profiler \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getProjectId\n\nProject ID is the ID of a cloud project.\n\nValidation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`.\n\n### setProjectId\n\nProject ID is the ID of a cloud project.\n\nValidation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`.\n\n### getTarget\n\nTarget is the service name used to group related deployments:\n\n- Service name for App Engine Flex / Standard.\n\n- Cluster and container name for GKE.\n\n- User-specified string for direct Compute Engine profiling (e.g. Java).\n- Job name for Dataflow. Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`.\n\n### setTarget\n\nTarget is the service name used to group related deployments:\n\n- Service name for App Engine Flex / Standard.\n\n- Cluster and container name for GKE.\n\n- User-specified string for direct Compute Engine profiling (e.g. Java).\n- Job name for Dataflow. Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`.\n\n### getLabels\n\nLabels identify the deployment within the user universe and same target.\n\nValidation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`.\nValue for an individual label must be \\\u003c= 512 bytes, the total\nsize of all label names and values must be \\\u003c= 1024 bytes.\nLabel named \"language\" can be used to record the programming language of\nthe profiled deployment. The standard choices for the value include \"java\",\n\"go\", \"python\", \"ruby\", \"nodejs\", \"php\", \"dotnet\".\nFor deployments running on Google Cloud Platform, \"zone\" or \"region\" label\nshould be present describing the deployment location. An example of a zone\nis \"us-central1-a\", an example of a region is \"us-central1\" or\n\"us-central\".\n\n### setLabels\n\nLabels identify the deployment within the user universe and same target.\n\nValidation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`.\nValue for an individual label must be \\\u003c= 512 bytes, the total\nsize of all label names and values must be \\\u003c= 1024 bytes.\nLabel named \"language\" can be used to record the programming language of\nthe profiled deployment. The standard choices for the value include \"java\",\n\"go\", \"python\", \"ruby\", \"nodejs\", \"php\", \"dotnet\".\nFor deployments running on Google Cloud Platform, \"zone\" or \"region\" label\nshould be present describing the deployment location. An example of a zone\nis \"us-central1-a\", an example of a region is \"us-central1\" or\n\"us-central\"."]]