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

Add trace visualization as a FlameGraph #976

Merged
merged 3 commits into from
Aug 10, 2022

Conversation

pavelpashkovsky
Copy link
Contributor

@pavelpashkovsky pavelpashkovsky commented Aug 5, 2022

Which problem is this PR solving?

We added the ability to visualize a trace as a flamegraph and thought it might be worth contributing upstream! Would love feedback on if it resolves this issue: #390

Resolves #525

Short description of the changes

182827151-2fc1819e-ceea-40b1-b4fd-40802cb90f8b.mp4

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing! 🥳

A couple of questions on the view:

  1. The table on the left seems sorted by Self column - is it possible to indicate that visually? I can't tell if the sorting is by Self or Total column, can only infer it from the data
  2. There is a Total/Self cell in the table that shows "< 0.01 sec" - is it informative? As I understand, "total" here refers to an implied span outside of the actual spans (judging by the flame graph itself, the top purple row), so under what condition could Total/Self be non-zero?

Lastly, please make sure all commits in the PR are signed (it's a CNCF licensing requirement).

@@ -0,0 +1,18 @@
/*
Copyright (c) 2017 Uber Technologies, Inc.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the copyright:

Suggested change
Copyright (c) 2017 Uber Technologies, Inc.
Copyright (c) 2022 The Jaeger Authors.

import './index.css';

const TraceFlamegraph = ({ trace }: any) => {
const convertedProfile = convertJaegerTraceToProfile(trace.data);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe, kinda nasty having this circular dependency on the internal data model, but ok.

Is it possible to add some basic test for this function in jaeger-ui project? The scenario I am worried about is if we decide to make changes to the trace data model (e.g. by switching to working with OTEL model natively), I would like that test to fail and flag the dependency issue. If convertJaegerTraceToProfile function was implemented right here it would be less of a problem (I assume you have internal unit tests for it).

@yurishkuro yurishkuro changed the title Trace flamegraph visualisation Add trace visualization as a FlameGraph Aug 5, 2022
@codecov
Copy link

codecov bot commented Aug 5, 2022

Codecov Report

Merging #976 (72e75b9) into main (d69509b) will decrease coverage by 0.03%.
The diff coverage is 80.00%.

❗ Current head 72e75b9 differs from pull request most recent head cef24cc. Consider uploading reports for the commit cef24cc to get more accurate results

@@            Coverage Diff             @@
##             main     #976      +/-   ##
==========================================
- Coverage   95.32%   95.29%   -0.04%     
==========================================
  Files         242      243       +1     
  Lines        7555     7560       +5     
  Branches     1890     1892       +2     
==========================================
+ Hits         7202     7204       +2     
- Misses        346      349       +3     
  Partials        7        7              
Impacted Files Coverage Δ
...nents/TracePage/TracePageHeader/AltViewOptions.tsx 100.00% <ø> (ø)
...kages/jaeger-ui/src/components/TracePage/index.tsx 99.41% <50.00%> (-0.59%) ⬇️
...src/components/TracePage/TraceFlamegraph/index.tsx 100.00% <100.00%> (ø)
...nents/TracePage/TraceTimelineViewer/SpanBarRow.tsx 94.44% <0.00%> (-5.56%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us.

);
};

export default TraceFlamegraph;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add some basic tests like "does not explode" and snapshot?

Signed-off-by: pavelpashkovsky <pavelpashkovsky@gmail.com>
Signed-off-by: pavelpashkovsky <pavelpashkovsky@gmail.com>
yurishkuro
yurishkuro previously approved these changes Aug 9, 2022
Signed-off-by: pavelpashkovsky <pavelpashkovsky@gmail.com>
@yurishkuro
Copy link
Member

Thank you!

@bobrik
Copy link
Contributor

bobrik commented Nov 2, 2022

There are some kinks with this: #1012.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support trace view as a flame graph
4 participants