Skip to content

Commit

Permalink
Fix: Deep clone trace data
Browse files Browse the repository at this point in the history
Signed-off-by: Kaung Zin Hein <[email protected]>
  • Loading branch information
Zen-cronic committed Jan 9, 2025
1 parent 843bf69 commit ce7a467
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
// limitations under the License.
import React from 'react';
import { FlamegraphRenderer, convertJaegerTraceToProfile } from '@pyroscope/flamegraph';
import _cloneDeep from 'lodash/cloneDeep';

import '@pyroscope/flamegraph/dist/index.css';
import './index.css';

const TraceFlamegraph = ({ trace }: any) => {
const convertedProfile = trace && trace.data ? convertJaegerTraceToProfile(trace.data) : null;
// Cloned b/c convertJaegerTraceToProfile or FlamegraphRenderer can possibly mutate the trace
const convertedProfile = trace && trace.data ? convertJaegerTraceToProfile(_cloneDeep(trace.data)) : null;

return (
<div className="Flamegraph-wrapper">
Expand Down

0 comments on commit ce7a467

Please sign in to comment.