profiles
Creates, updates, deletes, gets or lists a profiles
resource.
Overview
Name | profiles |
Type | Resource |
Id | google.cloudprofiler.profiles |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Output only. Opaque, server-assigned, unique ID for this profile. |
deployment | object | Deployment contains the deployment identification information. |
duration | string | Duration of the profiling session. Input (for the offline mode) or output (for the online mode). The field represents requested profiling duration. It may slightly differ from the effective profiling duration, which is recorded in the profile data, in case the profiling can't be stopped immediately (e.g. in case stopping the profiling is handled asynchronously). |
labels | object | Input only. Labels associated to this specific profile. These labels will get merged with the deployment labels for the final data set. See documentation on deployment labels for validation rules and limits. |
profileBytes | string | Input only. Profile bytes, as a gzip compressed serialized proto, the format is https://github.com/google/pprof/blob/master/proto/profile.proto. |
profileType | string | Type of profile. For offline mode, this must be specified when creating the profile. For online mode it is assigned and returned by the server. |
startTime | string | Output only. Start time for the profile. This output is only present in response from the ListProfiles method. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
list | SELECT | projectsId | Lists profiles which have been collected so far and for which the caller has permission to view. |
create | INSERT | projectsId | CreateProfile creates a new profile resource in the online mode. Direct use of this API is discouraged, please use a supported profiler agent instead for profile collection. The server ensures that the new profiles are created at a constant rate per deployment, so the creation request may hang for some time until the next profile session is available. The request may fail with ABORTED error if the creation is not available within ~1m, the response will indicate the duration of the backoff the client should take before attempting creating a profile again. The backoff duration is returned in google.rpc.RetryInfo extension on the response status. To a gRPC client, the extension will be return as a binary-serialized proto in the trailing metadata item named "google.rpc.retryinfo-bin". |
patch | UPDATE | profilesId, projectsId | UpdateProfile updates the profile bytes and labels on the profile resource created in the online mode. Updating the bytes for profiles created in the offline mode is currently not supported: the profile content must be provided at the time of the profile creation. Direct use of this API is discouraged, please use a supported profiler agent instead for profile collection. |
SELECT
examples
Lists profiles which have been collected so far and for which the caller has permission to view.
SELECT
name,
deployment,
duration,
labels,
profileBytes,
profileType,
startTime
FROM google.cloudprofiler.profiles
WHERE projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new profiles
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.cloudprofiler.profiles (
projectsId,
deployment,
profileType
)
SELECT
'{{ projectsId }}',
'{{ deployment }}',
'{{ profileType }}'
;
- name: your_resource_model_name
props:
- name: deployment
value:
- name: projectId
value: string
- name: target
value: string
- name: labels
value: object
- name: profileType
value:
- string
UPDATE
example
Updates a profiles
resource.
/*+ update */
UPDATE google.cloudprofiler.profiles
SET
profileType = '{{ profileType }}',
deployment = '{{ deployment }}',
duration = '{{ duration }}',
profileBytes = '{{ profileBytes }}',
labels = '{{ labels }}'
WHERE
profilesId = '{{ profilesId }}'
AND projectsId = '{{ projectsId }}';