Skip to content
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

feat: CallGraph API #3178

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions api/querier/v1/querier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,34 @@ message SelectSeriesRequest {
message SelectSeriesResponse {
repeated types.v1.Series series = 1;
}

message CallGraph {
repeated CallGraphNode nodes = 1;
repeated CallGraphEdge edges = 2;
// The total weight of the graph before truncation, used to compute percentages.
uint64 total_value = 3;
// The total number of nodes in the source graph before truncation.
uint64 nodes_total = 4;
}

message CallGraphNode {
// Values associated to this node. Self is exclusive to this node,
// total includes all descendents.
uint64 total = 1;
uint64 self = 2;
string name = 3;
}
Comment on lines +163 to +169
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we use strings without indirection as in flame graph or pprof formats. The reason is that call graph nodes never duplicate; therefore, the names are meant to be unique.

In contrast to the call graph implementation in the pprof tool, we only keep the display name of the function. Function details such as file name, line number, versions, etc. should be retrieved via separate API (shared with flame graphs).


message CallGraphEdge {
// source is the index of the source node in the nodes array.
uint32 source = 1;
// destination is the index of the destination node in the nodes array.
uint32 destination = 2;
// sum of samples the edge represents.
uint64 total = 3;
// residual edges connect nodes that were connected through a
// separate node, which has been removed from the report.
bool residual = 4;
// An inline edge represents a call that was inlined into the caller.
bool inline = 5;
}
Loading