Skip to content

Commit bc71fd7

Browse files
authored
fix: Use trimmed package name for flamegraph (#97436)
The aggregate flamegraph on the transaction summary page is getting the flamegraph data from vroom which is already applying package name trimming when it aggregates the flamegraphs. However the individual profile view did not do this and showed the whole package name, which wasn't a good UX. Before: <img width="1980" height="374" alt="Screenshot 2025-08-07 at 5 08 46 PM" src="https://github.com/user-attachments/assets/0ebe228f-edf4-4c49-9217-d3c6d6cabfe4" /> After: <img width="1228" height="386" alt="Screenshot 2025-08-07 at 5 08 23 PM" src="https://github.com/user-attachments/assets/58e4e127-ecfb-4edd-9731-63f2563bd85e" />
1 parent 0cc3e77 commit bc71fd7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

static/app/utils/profiling/frame.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {trimPackage} from 'sentry/components/events/interfaces/frame/utils';
12
import type {SymbolicatorStatus} from 'sentry/components/events/interfaces/types';
23
import {t} from 'sentry/locale';
34

@@ -159,8 +160,9 @@ export class Frame {
159160
}
160161

161162
getSourceLocation(): string {
163+
const trimmedPackage = this.package ? trimPackage(this.package) : this.package;
162164
const packageFileOrPath: string =
163-
this.file ?? this.module ?? this.package ?? this.path ?? '<unknown>';
165+
this.file ?? this.module ?? trimmedPackage ?? this.path ?? '<unknown>';
164166

165167
const line = typeof this.line === 'number' ? this.line : '<unknown line>';
166168
const column = typeof this.column === 'number' ? this.column : '<unknown column>';

0 commit comments

Comments
 (0)