profiles
Creates, updates, deletes, gets or lists a profiles
resource.
Overview
Name | profiles |
Type | Resource |
Id | google.cloudprofiler.profiles |
Fields
The following fields are returned by SELECT
queries:
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Opaque, server-assigned, unique ID for this profile. |
deployment | object | Deployment this profile corresponds to. (id: Deployment) |
duration | string (google-duration) | 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 (byte) | 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 (google-datetime) | Output only. Start time for the profile. This output is only present in response from the ListProfiles method. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list | select | projectsId | pageSize , pageToken | 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 | projectsId , profilesId | updateMask | 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. |
create_offline | exec | projectsId | CreateOfflineProfile creates a new profile resource in the offline mode. The client provides the profile to create along with the profile bytes, the server records it. Direct use of this API is discouraged, please use a supported profiler agent instead for profile collection. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
profilesId | string | |
projectsId | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- list
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 }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
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".
INSERT INTO google.cloudprofiler.profiles (
data__deployment,
data__profileType,
projectsId
)
SELECT
'{{ deployment }}',
'{{ profileType }}',
'{{ projectsId }}'
RETURNING
name,
deployment,
duration,
labels,
profileBytes,
profileType,
startTime
;
# Description fields are for documentation purposes
- name: profiles
props:
- name: projectsId
value: string
description: Required parameter for the profiles resource.
- name: deployment
value: object
description: >
Deployment details.
- name: profileType
value: array
description: >
One or more profile types that the agent is capable of providing.
UPDATE
examples
- patch
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.
UPDATE google.cloudprofiler.profiles
SET
data__profileType = '{{ profileType }}',
data__deployment = '{{ deployment }}',
data__duration = '{{ duration }}',
data__profileBytes = '{{ profileBytes }}',
data__labels = '{{ labels }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND profilesId = '{{ profilesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
deployment,
duration,
labels,
profileBytes,
profileType,
startTime;
Lifecycle Methods
- create_offline
CreateOfflineProfile creates a new profile resource in the offline mode. The client provides the profile to create along with the profile bytes, the server records it. Direct use of this API is discouraged, please use a supported profiler agent instead for profile collection.
EXEC google.cloudprofiler.profiles.create_offline
@projectsId='{{ projectsId }}' --required
@@json=
'{
"profileType": "{{ profileType }}",
"deployment": "{{ deployment }}",
"duration": "{{ duration }}",
"profileBytes": "{{ profileBytes }}",
"labels": "{{ labels }}"
}';