Skip to content

feat(apm): Initial transactions view #13920

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

Merged
merged 25 commits into from
Jul 25, 2019
Merged

feat(apm): Initial transactions view #13920

merged 25 commits into from
Jul 25, 2019

Conversation

dashed
Copy link
Member

@dashed dashed commented Jul 8, 2019

WORK IN PROGRESS

PR dependencies

TODO (top-level)

TODO (trace view)

There are 2 versions of the trace view that can be explored.

  • trace view
  • span detail view
  • zebra rows EDIT: removed
  • add colour palettes to differentiate spans.
  • span row message
  • span bar error visual cue
  • expand/collapse span tree
  • span tree HUD

TODO (minimap)

  • view window
  • view window draggable handles
  • drag management
  • fog view
  • commit phase after dragging

Deferred to a follow-up PR

This follow-up PR will cover https://getsentry.atlassian.net/browse/SEN-866

  • acceptance test: trace view
  • acceptance test: empty transactions events list
  • acceptance test: non-empty transactions events list
  • drag view window (without changing its window size)
  • select window size by dragging onto the minimap
  • mouse guide cursor should display current duration + timestamp
  • mouse guide cursor should display a guide cursor in the trace view
  • russian doll-ing of spans for collapsed span trees (maybe)

Closes SEN-808
Closes SEN-846

@dashed dashed added the WIP label Jul 8, 2019
@dashed dashed self-assigned this Jul 8, 2019
@dashed dashed force-pushed the transactions-view branch 4 times, most recently from 98faa8b to 607e0e1 Compare July 12, 2019 21:02
@dashed dashed force-pushed the transactions-view branch from b9b15fa to f6d2081 Compare July 15, 2019 04:54

const parsedTrace = this.parseTrace();

// TODO: ideally this should be provided
Copy link
Member

Choose a reason for hiding this comment

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

Would you want this from the API? The API could ensure that all spans are ordered by start timestamp.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep :D

I saw #14007

@dashed dashed force-pushed the transactions-view branch 5 times, most recently from 30c6aa2 to 446f54e Compare July 18, 2019 22:01
@dashed dashed changed the title feat(ui): Initial transactions view feat(apm): Initial transactions view Jul 19, 2019
@dashed dashed changed the title feat(apm): Initial transactions view feat(aom): Initial transactions view Jul 19, 2019
@dashed dashed changed the title feat(aom): Initial transactions view feat(apm): Initial transactions view Jul 19, 2019
@dashed dashed force-pushed the transactions-view branch from 0f3b321 to f593680 Compare July 19, 2019 16:23
@codecov
Copy link

codecov bot commented Jul 20, 2019

Codecov Report

Merging #13920 into master will increase coverage by 3.95%.
The diff coverage is 21.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13920      +/-   ##
==========================================
+ Coverage    82.7%   86.66%   +3.95%     
==========================================
  Files        3221     3230       +9     
  Lines      140352   140847     +495     
  Branches     4953     5009      +56     
==========================================
+ Hits       116077   122059    +5982     
+ Misses      22887    17398    -5489     
- Partials     1388     1390       +2
Impacted Files Coverage Δ
src/sentry/static/sentry/app/sentryTypes.jsx 100% <ø> (ø) ⬆️
...static/sentry/app/components/eventOrGroupTitle.jsx 100% <ø> (ø) ⬆️
...atic/sentry/app/components/events/eventEntries.jsx 40% <ø> (-4.45%) ⬇️
...atic/sentry/app/components/events/groupingInfo.jsx 21.66% <ø> (ø) ⬆️
...tatic/sentry/app/components/eventOrGroupHeader.jsx 63.63% <ø> (ø) ⬆️
...tic/sentry/app/views/organizationEventsV2/data.jsx 47.91% <0%> (-5.58%) ⬇️
...y/app/components/events/interfaces/spans/index.tsx 0% <0%> (ø)
...omponents/events/interfaces/spans/drag_manager.tsx 12% <12%> (ø)
...nents/events/interfaces/spans/transaction_view.tsx 18.18% <18.18%> (ø)
...p/components/events/interfaces/spans/span_tree.tsx 20.39% <20.39%> (ø)
... and 340 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b141ab...a2b3050. Read the comment docs.

@dashed dashed force-pushed the transactions-view branch from c16ae14 to 006bd9d Compare July 22, 2019 16:15
@dashed dashed force-pushed the transactions-view branch 4 times, most recently from ef17136 to 581df13 Compare July 23, 2019 15:00
@dashed dashed force-pushed the transactions-view branch 3 times, most recently from 8e552bf to 727eac9 Compare July 23, 2019 23:29
@dashed dashed force-pushed the transactions-view branch from 38e4cff to ce5b6ee Compare July 25, 2019 14:33
Copy link
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

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

Mashing approve on this as we need this to unblock other work around the APM-ui and tests can be added once the implementation/design settle down a bit.

@dashed dashed merged commit 9b4a214 into master Jul 25, 2019
@dashed dashed deleted the transactions-view branch July 25, 2019 16:10
return;
}

const rect = rectOfContent(this.props.interactiveLayerRef.current!);
Copy link
Member

Choose a reason for hiding this comment

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

what does the ! do at the end?

Copy link
Member

Choose a reason for hiding this comment

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

It tells the TS compiler that current will is not going to be null/undefined

Copy link
Member Author

Choose a reason for hiding this comment

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

The ! operator is useful in cases when TS isn't smart enough to know that this.props.interactiveLayerRef.current has been checked to not be null earlier.

more info here: https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#non-null-assertion-operator

Copy link
Member Author

Choose a reason for hiding this comment

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

This operator will definitely be useful during the TS migration.


// remove listeners that were attached in onDragStart

window.removeEventListener('mousemove', this.onDragMove);
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible this component unmounts before a dragend event happens?

Copy link
Member Author

Choose a reason for hiding this comment

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

Very good point 👍

I'm going to consolidate the clean up steps into a function (e.g. restoring the body style) on the next iteration of the APM frontend implementation.


render() {
return (
<React.Fragment>
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed?

});
}}
>
<InteractiveLayer style={{overflow: 'visible'}}>
Copy link
Member

Choose a reason for hiding this comment

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

Can we move the inline style into the styled component?

);
};

renderViewHandles = ({
Copy link
Member

Choose a reason for hiding this comment

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

It might make Minimap a bit easier to read if some of these render methods were components.

<React.Fragment>
<SpanRow
data-span-hidden={isVisible ? 'false' : 'true'}
style={{
Copy link
Member

Choose a reason for hiding this comment

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

Would prefer this to be handled in the SC

transition: background-color 0.15s ease-in-out;

&:last-child {
& > [data-component='span-detail'] {
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 avoid using data attributes for presentation like this

&:hover {
background-color: rgba(189, 180, 199, 0.1);

& > [data-span='true'] {
Copy link
Member

Choose a reason for hiding this comment

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

e.g. for this we could have in SpanBar

${SpanRow}:hover & {
    transition: border-color 0.15s ease-in-out;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

Otherwise we have another set of attributes to keep track of (and there's no build time checks for data attribute refereces)


// sort span children by their start timestamps in ascending order

forEach(reduced.lookup, spanChildren => {
Copy link
Member

Choose a reason for hiding this comment

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

nit, can we use Object.values().forEach() instead of lodash?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep will do 😄

@billyvg
Copy link
Member

billyvg commented Jul 25, 2019

sorry, late to the party @dashed

@dashed
Copy link
Member Author

dashed commented Jul 27, 2019

@billyvg Apologizes, I just these your feedback comments just now.

I'm going to note all of them down for the next iteration of the APM UI.

Due to the nature of the new designs, I will be throwing away some of the implementation from this PR.

@dashed dashed mentioned this pull request Jul 31, 2019
19 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants