Skip to content

Ad Hoc Profiles #2963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7ae14a3
Define initial contract for Ad Hoc profiles
aleks-p Jan 19, 2024
d07c8df
Initial implementation of the Ad Hoc APIs
aleks-p Jan 19, 2024
7087eb6
Include profile name in upload api
aleks-p Jan 19, 2024
c60f6e8
Handle multiple sample types within a pprof gracefully
aleks-p Jan 19, 2024
1be721b
Add API docs
aleks-p Jan 19, 2024
c5d5df6
Return ad hoc profiles in full flamebearer profile format
aleks-p Jan 22, 2024
ca7b757
Revert proto refactoring
aleks-p Jan 22, 2024
248b914
Add max_nodes to the Ad Hoc Profiles APIs
aleks-p Jan 22, 2024
5569534
Merge remote-tracking branch 'origin/main' into feat/ad-hoc-component
aleks-p Jan 23, 2024
b8bd69d
Restore convert package from OG Pyroscope to handle multiple profile …
aleks-p Jan 23, 2024
6913c09
Simplify API, rename fields for clarity, fix profileTypes field for J…
aleks-p Jan 24, 2024
8f58097
Move Ad Hoc Profiles to a new Sidekick module
aleks-p Jan 24, 2024
ed11c90
Merge remote-tracking branch 'origin/main' into feat/ad-hoc-component
aleks-p Jan 24, 2024
b49ffd2
Switch uploaded_at to timestamp, update docs
aleks-p Jan 24, 2024
b372c5b
Improve naming, execution order
aleks-p Jan 24, 2024
fcdc67a
Add todo for tenant limits
aleks-p Jan 24, 2024
c248180
Move the convert package to its original location, restore tests
aleks-p Jan 24, 2024
ad79c09
Make ad-hoc-profiles its own module
aleks-p Jan 25, 2024
4241ffd
Fix lint error
aleks-p Jan 25, 2024
e90193b
Merge remote-tracking branch 'origin/main' into feat/ad-hoc-component
aleks-p Jan 25, 2024
e2602c8
Improve key parsing for the /List call
aleks-p Jan 26, 2024
6061222
Simplify bucket creation
aleks-p Jan 26, 2024
e623efa
Add tests for the ad hoc profile handlers
aleks-p Jan 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions api/adhocprofiles/v1/adhocprofiles.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
syntax = "proto3";

package adhocprofiles.v1;

import "types/v1/types.proto";

service AdHocProfileService {
// Upload a profile to the underlying store. The request contains a name and a base64 encoded pprof file. The response
// contains a generated unique identifier, a flamegraph and a list of found sample types within the profile.
rpc Upload(AdHocProfilesUploadRequest) returns (AdHocProfilesGetResponse) {}

// Retrieves a profile from the underlying store by id and an optional sample type. The response is similar to the one
// for the upload method.
rpc Get(AdHocProfilesGetRequest) returns (AdHocProfilesGetResponse) {}

// Retrieves a list of profiles found in the underlying store.
rpc List(AdHocProfilesListRequest) returns (AdHocProfilesListResponse) {}
}

message AdHocProfilesUploadRequest {
// This is typically the file name and it serves as a human readable name for the profile.
string name = 1;
// This is the profile encoded in base64. The supported formats are pprof, json, collapsed and perf-script.
string profile = 2;
// Max nodes can be used to truncate the response.
optional int64 max_nodes = 3;
}

message AdHocProfilesGetRequest {
// The unique identifier of the profile.
string id = 1;
// The desired profile type (e.g., cpu, samples) for the returned flame graph. If omitted the first profile is returned.
optional string profile_type = 2;
// Max nodes can be used to truncate the response.
optional int64 max_nodes = 3;
}

message AdHocProfilesGetResponse {
string id = 1;
string name = 2;
// timestamp in milliseconds
int64 uploaded_at = 3;
string profile_type = 4;
// Some profiles formats (like pprof) can contain multiple profile (sample) types inside. One of these can be passed
// in the Get request using the profile_type field.
repeated string profile_types = 5;
string flamebearer_profile = 6;
}

message AdHocProfilesListRequest {}

message AdHocProfilesListResponse {
repeated AdHocProfilesProfileMetadata profiles = 1;
}

message AdHocProfilesProfileMetadata {
string id = 1;
string name = 2;
// timestamp in milliseconds
int64 uploaded_at = 3;
}
Loading