grafana / pyroscope

Continuous Profiling Platform. Debug performance issues down to a single line of code
https://grafana.com/oss/pyroscope/
GNU Affero General Public License v3.0
9.65k stars 576 forks source link

Provide API to access span IDs in profiles #3343

Open simonswine opened 4 weeks ago

simonswine commented 4 weeks ago

Currently there is no way of accessing the SpanIDs which are existing in Pyroscope profile table. We should provide an endpoint that can list span IDs for a given profile series label selector and time window. It also should optionally accept filtering for span IDs, to test their existence and total value.

// Ability to list span ids by profile series selector, and optionally a list of spanIDs
message ListSpanIDRequest {
  repeated string matchers = 1;
  // Milliseconds since epoch. If missing or zero, only the ingesters will be
  // queried.
  int64 start = 2;
  // Milliseconds since epoch. If missing or zero, only the ingesters will be
  // queried.
  int64 end = 3;
  // if given restrict to those span IDs
  repeated string span_ids = 4;
  // TODO: Pagination
}

message ListSpanIDsResponse {
  repeated string span_ids = 1;
  repeated string total_values = 2;
}

This could provde a good integration into getting extra span information from Tempo.