|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +package adhocprofiles.v1; |
| 4 | + |
| 5 | +import "types/v1/types.proto"; |
| 6 | + |
| 7 | +service AdHocProfileService { |
| 8 | + // Upload a profile to the underlying store. The request contains a name and a base64 encoded pprof file. The response |
| 9 | + // contains a generated unique identifier, a flamegraph and a list of found sample types within the profile. |
| 10 | + rpc Upload(AdHocProfilesUploadRequest) returns (AdHocProfilesGetResponse) {} |
| 11 | + |
| 12 | + // Retrieves a profile from the underlying store by id and an optional sample type. The response is similar to the one |
| 13 | + // for the upload method. |
| 14 | + rpc Get(AdHocProfilesGetRequest) returns (AdHocProfilesGetResponse) {} |
| 15 | + |
| 16 | + // Retrieves a list of profiles found in the underlying store. |
| 17 | + rpc List(AdHocProfilesListRequest) returns (AdHocProfilesListResponse) {} |
| 18 | +} |
| 19 | + |
| 20 | +message AdHocProfilesUploadRequest { |
| 21 | + // This is typically the file name and it serves as a human readable name for the profile. |
| 22 | + string name = 1; |
| 23 | + // This is the profile encoded in base64. The supported formats are pprof, json, collapsed and perf-script. |
| 24 | + string profile = 2; |
| 25 | + // Max nodes can be used to truncate the response. |
| 26 | + optional int64 max_nodes = 3; |
| 27 | +} |
| 28 | + |
| 29 | +message AdHocProfilesGetRequest { |
| 30 | + // The unique identifier of the profile. |
| 31 | + string id = 1; |
| 32 | + // The desired profile type (e.g., cpu, samples) for the returned flame graph. If omitted the first profile is returned. |
| 33 | + optional string profile_type = 2; |
| 34 | + // Max nodes can be used to truncate the response. |
| 35 | + optional int64 max_nodes = 3; |
| 36 | +} |
| 37 | + |
| 38 | +message AdHocProfilesGetResponse { |
| 39 | + string id = 1; |
| 40 | + string name = 2; |
| 41 | + // timestamp in milliseconds |
| 42 | + int64 uploaded_at = 3; |
| 43 | + string profile_type = 4; |
| 44 | + // Some profiles formats (like pprof) can contain multiple profile (sample) types inside. One of these can be passed |
| 45 | + // in the Get request using the profile_type field. |
| 46 | + repeated string profile_types = 5; |
| 47 | + string flamebearer_profile = 6; |
| 48 | +} |
| 49 | + |
| 50 | +message AdHocProfilesListRequest {} |
| 51 | + |
| 52 | +message AdHocProfilesListResponse { |
| 53 | + repeated AdHocProfilesProfileMetadata profiles = 1; |
| 54 | +} |
| 55 | + |
| 56 | +message AdHocProfilesProfileMetadata { |
| 57 | + string id = 1; |
| 58 | + string name = 2; |
| 59 | + // timestamp in milliseconds |
| 60 | + int64 uploaded_at = 3; |
| 61 | +} |
0 commit comments