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.98k stars 598 forks source link

Reduce confusion with profile types in Pyroscope #3319

Open simonswine opened 4 months ago

simonswine commented 4 months ago

Pyroscope uses profile types as a quite prominent feature in API and UI. The same time we are hiding the full profile type many times. The full profile type contains:

 <name>:<sample-type>:<sample-unit>:<period-type>:<period-unit>
Here is a list of full profile types in GL largest cells: ``` block contentions count contentions count block delay nanoseconds contentions count godeltaprof_block contentions count contentions count godeltaprof_block delay nanoseconds contentions count godeltaprof_memory alloc_objects count space bytes godeltaprof_memory alloc_space bytes space bytes godeltaprof_memory inuse_objects count space bytes godeltaprof_memory inuse_space bytes space bytes godeltaprof_mutex contentions count contentions count godeltaprof_mutex delay nanoseconds contentions count goroutine goroutine count goroutine count goroutines goroutine count goroutine count memory alloc_in_new_tlab_bytes bytes space bytes memory alloc_in_new_tlab_objects count space bytes memory alloc_objects count space bytes memory alloc_space bytes space bytes memory inuse_objects count space bytes memory inuse_space bytes space bytes mutex contentions count contentions count mutex contentions count mutex count mutex delay nanoseconds contentions count mutex delay nanoseconds mutex count process_cpu alloc_samples count cpu nanoseconds process_cpu alloc_size bytes cpu nanoseconds process_cpu cpu nanoseconds cpu nanoseconds process_cpu exception count cpu nanoseconds process_cpu lock_count count cpu nanoseconds process_cpu lock_time nanoseconds cpu nanoseconds process_cpu samples count milliseconds process_cpu samples count cpu nanoseconds ```

In order to simplify this I propose that we implement:

### Tasks
- [ ] Support 4 part `__profile_type__` as `block:contentions:count`, which ignores period unit/type.
- [ ]  Rewrite `__name__` during ingestion to ensure consistency
- [ ] Deprecate ProfileType call and arguments in favour of LabelValues / Series and LabelSelectors
simonswine commented 4 months ago

cc @petethepig from our conversation

wang-qijia commented 2 months ago

From the user's perspective, this implementation is meaningful and reduces cognitive load.