Fix handling the stackframes response from the ES plugin (#150205)

## Summary
Flamegraph and TopN Functions don't display currently.
The reason is a missing backwards compatibility in the handling/parsing
of stackframes.
This is  quick fix to avoid blocking other PRs.

See https://github.com/elastic/prodfiler/issues/2951

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Tim Rühsen 2023-02-03 02:13:03 +01:00 committed by GitHub
parent be37fa1190
commit 14af4a1643
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,8 +36,8 @@ export function decodeStackTraceResponse(response: StackTraceResponse) {
const stackFrames: Map<StackFrameID, StackFrame> = new Map();
for (const [key, value] of Object.entries(response.stack_frames ?? {})) {
stackFrames.set(key, {
FileName: value.file_name,
FunctionName: value.function_name,
FileName: value.file_name ? value.file_name[0] : [],
FunctionName: value.function_name ? value.function_name[0] : [],
FunctionOffset: value.function_offset,
LineNumber: value.line_number,
} as StackFrame);