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 tooltip when hovering Critical Path #1871

Merged
merged 10 commits into from
Oct 22, 2023

Conversation

GLVSKiriti
Copy link
Contributor

Which problem is this PR solving?

Description of the changes

  • Added Tooltip which is visible on hovering the critical path

@yurishkuro

Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
@GLVSKiriti
Copy link
Contributor Author

tooltipCriticalPath

@codecov
Copy link

codecov bot commented Oct 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
...mponents/TracePage/TraceTimelineViewer/SpanBar.tsx 100.00% <ø> (ø)
...ePage/TraceTimelineViewer/VirtualizedTraceView.tsx 97.67% <100.00%> (+0.72%) ⬆️

... and 2 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

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, looks good. I suggested a change to the wording to be a bit more explicit. An even more advanced form would be to use display similar to logs where we show a full list of CP segments in the span with some of their stats, like start, end, % of total CP. But we can start with just static popup.

There is one issue currently, though. When the span also has log ticks, it's almost impossible to get the logs popup to show if there's also a CP segment in the same timeframe. Somehow we need to make sure that the logs tooltip takes priority over CP. Perhaps this could be achieved with z-order, I am not sure.

image

cc @anshgoyalevil

@anshgoyalevil
Copy link
Member

anshgoyalevil commented Oct 15, 2023

I just gave it a go, and yes, the zIndex solution would work here.

<div
  data-testid="SpanBar--logMarker"
  className="SpanBar--logMarker"
  style={{ left: positionKey, zIndex: 3}}
/>

(I tried with the value 3 (zIndex). Anything lower than that wouldn't work.)

A design suggestion: Can we change the color of CP on mouse hover? It would make more sense to the user that ToolTip is related the CP, and not the whole span.

@anshgoyalevil
Copy link
Member

@yurishkuro
How about an addition? Color change on hover
20dntwuf

@yurishkuro
Copy link
Member

How about an addition? Color change on hover

Not a bad idea, as long as the color is distinct from the span color palette. E.g., don't we already use brown for spans?

I also think it would be nice for the log ticks to enlarge when hovered (like using a bolder line), and maybe have a slightly larger clickable bounding box. Right now it takes very fine pointing to get a popup from a log tick.

@anshgoyalevil
Copy link
Member

anshgoyalevil commented Oct 15, 2023

don't we already use brown for spans?

We already use maybe. Not sure though, I chose brown just for example

I also think it would be nice for the log ticks to enlarge when hovered (like using a bolder line), and maybe have a slightly larger clickable bounding box. Right now it takes very fine pointing to get a popup from a log tick.

As far as I understand, isn't the size of that point so thin, to accommodate all ticks in a continuous timeframe of milliseconds?

Another POV, we can increase the groupBy roundoff percentage on L93 to accommodate more logs under a single bold tick

@yurishkuro
Copy link
Member

so thin, to accommodate all ticks in a continuous timeframe of milliseconds

Yes, but when you have too many logs clustered together no matter what you do they will not be distinguishable without zooming in on the timeline. For comparison, Zipkin UI used to use oval pills to represent event (much thicker than our ticks):

image

@anshgoyalevil
Copy link
Member

Ah yes, I forgot that the end users can zoom in on the timeline.

…r/SpanBar.tsx

Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Signed-off-by: GLVSKiriti <116095646+GLVSKiriti@users.noreply.github.com>
@GLVSKiriti
Copy link
Contributor Author

Not a bad idea, as long as the color is distinct from the span color palette. E.g., don't we already use brown for spans?

What about color White?
cpOnHover

@yurishkuro
Copy link
Member

We have many light colors like yellow in the same pic, I'm not sure white will be contrasting enough on those. May we could do animation of white spot running left to right once?

@GLVSKiriti
Copy link
Contributor Author

May we could do animation of white spot running left to right once?

We can adjust the spot width and time
singleSpan

But if child spans are collapsed then it would be like this
paretnSpan

Is this ok?

@yurishkuro
Copy link
Member

The first s/s is awesome!

When children are collapsed, wouldn't the CP segments have identical edge timestamps, like [t1, t2], [t2, t3], ...? If so, why don't we merge them? It would help this running spot, and in general it's meaningless to have adjacent CP segments without a gap between them.

Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
@GLVSKiriti
Copy link
Contributor Author

When children are collapsed, wouldn't the CP segments have identical edge timestamps, like [t1, t2], [t2, t3], ...? If so, why don't we merge them? It would help this running spot, and in general it's meaningless to have adjacent CP segments without a gap between them.

Yep I merged the CP segments and the result would be like this!
Screencast from 17-10-23 11 44 56 AM IST

I also think it would be nice for the log ticks to enlarge when hovered (like using a bolder line),

And I also increased size of log ticks !

Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
…s collapsed

Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
@GLVSKiriti GLVSKiriti requested a review from a team as a code owner October 22, 2023 10:02
Removed unnecessary else if

Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
// If the span is collapsed, recursively find all of its descendants.
const findAllDescendants = (currentChildSpanIds: string[]) => {
currentChildSpanIds.forEach(eachId => {
const currentChildSpan = trace.spans.find(a => a.spanID === eachId)!;
Copy link
Member

Choose a reason for hiding this comment

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

We should really just add a helper method to the Trace object: trace.findSpan(spanID)

@yurishkuro yurishkuro added the changelog:new-feature Change that should be called out as new feature in CHANGELOG label Oct 22, 2023
@yurishkuro yurishkuro changed the title Added Tooltip on hovering Critical Path Add tooltip when hovering Critical Path Oct 22, 2023
@yurishkuro yurishkuro merged commit c44ab81 into jaegertracing:main Oct 22, 2023
10 of 11 checks passed
@yurishkuro
Copy link
Member

thanks!

@GLVSKiriti
Copy link
Contributor Author

GLVSKiriti commented Oct 22, 2023

what about adding a helper method trace.findSpan(spanID)?Should I do it in seperate PR

@GLVSKiriti GLVSKiriti deleted the criticalPathTooltip branch October 22, 2023 18:20
@yurishkuro
Copy link
Member

Well, to be honest, and I raised this during the project, this whole searching should go away. We build a proper tree in one place, we should just keep it as part of the trace and always navigate it, instead of doing the same work over and over. All these searches are O(N).

@bobrik
Copy link
Contributor

bobrik commented Feb 20, 2024

This might be pretty taxing on CPU usage. We're seeing very slow tag expansion in spans in large traces.

Here's me clicking to expand the tags and then to collapse them back:

image image

@yurishkuro
Copy link
Member

@bobrik please open a new ticket. You can disable critical path for all traces via config, but there's certainly room for perf optimization.

@bobrik
Copy link
Contributor

bobrik commented Feb 20, 2024

I filed #2179 for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:new-feature Change that should be called out as new feature in CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants