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

[flamegraph] Truncate function names on small nodes #271

Open
grafakus opened this issue Nov 11, 2024 · 1 comment
Open

[flamegraph] Truncate function names on small nodes #271

grafakus opened this issue Nov 11, 2024 · 1 comment

Comments

@grafakus
Copy link
Contributor

grafakus commented Nov 11, 2024

Feature description

Is your feature request related to a problem? Please describe.

Long package/function names are impossible to read on small nodes

Describe the solution you'd like

We should provide a way to truncate the full function name either by:

  • automatically displaying only the function name on small nodes (like https://gotraceui.dev/ does), or
  • by providing buttons on the UI to remove/add parts of the full name (truncate until the next slash, for instance)

(github.com/grafana/quickpizza/pkg/http.(*Server).ServeHTTP becomes grafana/quickpizza/pkg/http.(*Server).ServeHTTP, then quickpizza/pkg/http.(*Server).ServeHTTP, etc.)

Alternatives considered

Describe alternatives you've considered

from @Rperry2174
Instead of a simple truncation, we could implement an incremental name expansion feature similar to the "decimal" button in Google Sheets. This approach allows users to progressively reveal more context in function names, based on logical segments (e.g., slashes / or dots .).

Example Table: Incremental Function Name Expansion

Language Full Function Name Initial Display 1st Press 2nd Press Full Display
Go github.com/grafana/quickpizza/pkg/http.(*Server).ServeHTTP ServeHTTP http.(*Server).ServeHTTP quickpizza/pkg/http.(*Server).ServeHTTP github.com/grafana/quickpizza/pkg/http.(*Server).ServeHTTP
Java com.example.myapp.services.UserService.getUserById getUserById UserService.getUserById services.UserService.getUserById com.example.myapp.services.UserService.getUserById
Python my_project.module.submodule.ClassName.method_name method_name ClassName.method_name submodule.ClassName.method_name my_project.module.submodule.ClassName.method_name

Why This Approach?

This method provides users with control over how much of the function name is displayed, helping them see relevant context without overwhelming them with the full string immediately. It avoids arbitrary truncation and adapts better to different naming conventions across languages.

-

Additional context

Slack context: https://raintank-corp.slack.com/archives/C048VSWPZ4P/p1721936010915859?thread_ts=1721935610.960829&cid=C048VSWPZ4P

@grafakus grafakus changed the title [flamegraph] Truncate function names [flamegraph] Truncate function names on small nodes Nov 11, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in 2 weeks if no further activity occurs.

@github-actions github-actions bot added the stale label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant