grafana / explore-profiles

Explore Profiles is a native Grafana application designed to integrate seamlessly with Pyroscope, the open-source continuous profiling platform, providing a smooth, query-less experience for browsing and analyzing profiling data.
GNU Affero General Public License v3.0
17 stars 1 forks source link

feat(*): Avoid no data panels #80

Closed grafakus closed 1 month ago

grafakus commented 1 month ago

โœจ Description

Related issue(s): solves https://github.com/grafana/explore-profiles/issues/74

This PR prevents showing panels with no data:

  1. For the grid panels, we use different queries for the serviceName and the profileMetricId variables, they now depend on the selected profile metric and the selected service name, respectively
  2. For the "Labels" and "Flame graph" exploration types, the "Profile type" selector in the UI also uses a query that depends on the service selected

Short video to illustrate the changes:

https://github.com/user-attachments/assets/6e81b1c3-a173-43fe-bfa3-84816edeccbc

๐Ÿ“– Summary of the changes

We've updated SeriesDataSource to support multiple queries ; we took the opportunity to update the data massaging after fetching from the /Series endpoint, creating lookup tables for both services โ†’ profile metrics and vice-versa.

Finally, the "Hide panels without data" switch has been removed from the "All services" & "Profile types" exploration type views.

See diff tab for specific comments.

๐Ÿงช How to test?

github-actions[bot] commented 1 month ago

Unit test coverage

Lines Statements Branches Functions
Coverage: 12%
12.77% (470/3679) 9.97% (138/1384) 9.66% (108/1118)