-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[APM] Show errors on the timeline instead of under the transaction #52863
[APM] Show errors on the timeline instead of under the transaction #52863
Conversation
...ls/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts
Outdated
Show resolved
Hide resolved
...ls/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts
Outdated
Show resolved
Hide resolved
...ls/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts
Outdated
Show resolved
Hide resolved
...ls/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts
Show resolved
Hide resolved
@@ -72,18 +73,33 @@ interface IWaterfallItemBase { | |||
childIds?: Array<IWaterfallItemBase['id']>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looks like childIds
is no longer used. Do you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I want to remove it in another PR, because I will also remove other properties.
id: error.error.id, | ||
parentId: error.parent?.id, | ||
serviceName: error.service.name, | ||
message: error.error.log?.message || error.error.exception?.[0]?.message, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we are adding more properties (like message
) to the top-level waterfallItem
which are irrelevant to the other types of items. Maybe we should strip it down to just the things that are required for positioning it on the timeline, and then make an open-ended doc
property that contains anything necessary for displaying it.
interface IWaterfallItemBase<T> {
custom: T;
/**
* Duration in us
*/
duration: number;
/**
* offset from first item in us
*/
offset: number;
/**
* skew from timestamp in us
*/
skew: number;
}
export type IWaterfallItem = IWaterfallItemBase<Transaction> | IWaterfallItemBase<Span>;
My intention is to make the interface as small as possible but I don't know if this is a good approach in practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sqren is it fine if I do this change in another PR? then I can remove the childIds
, getTransactionById
and other properties which are not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
([name, ms]) => | ||
({ | ||
id: name, | ||
name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having name
looks a bit odd. Maybe another reason for keeping the custom data in a specific field:
{
custom: { customData... },
offset: ms * 1000,
docType: 'agentMark'
}
...ls/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts
Outdated
Show resolved
Hide resolved
...ls/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts
Outdated
Show resolved
Hide resolved
...ls/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts
Outdated
Show resolved
Hide resolved
...ls/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts
Outdated
Show resolved
Hide resolved
...ls/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts
Outdated
Show resolved
Hide resolved
5f09af6
to
227eb30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks terrific! A few nits around the use of styled components > existing or EUI components. Small font size suggestion too.
x-pack/legacy/plugins/apm/public/components/shared/charts/Timeline/Marker/ErrorMarker.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/apm/public/components/shared/charts/Timeline/Marker/ErrorMarker.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/apm/public/components/shared/charts/Timeline/Marker/ErrorMarker.tsx
Outdated
Show resolved
Hide resolved
295fd7c
to
9dcdecf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a couple of style suggestions. Other than that, I found that the placement of the popover covers the original click-area of the square icon. Is it possible to move the popover offset above the square?
The last thing is whether we should simply set the skewed timestamp, if negative values, to <0 ms
? Just to indicate that, yes there's skew, but not necessarily show the full negative timestamp.
x-pack/legacy/plugins/apm/public/components/shared/charts/Timeline/Marker/ErrorMarker.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/apm/public/components/shared/charts/Timeline/Marker/ErrorMarker.tsx
Outdated
Show resolved
Hide resolved
@formgeist have you pulled my last changes? if yes can you send me the link to this waterfall? |
Awesome! Not sure if you haven't gotten there yet, but did you look into repositioning the popover against the square icon? As I mentioned earlier, the popover arrow is covering the square, which means the option to click it again is a little hard. Understandably, the user can click anywhere outside the popover, but it's also a visual thing when comparing it to the other mark tooltips. Current position Suggested position |
@formgeist WDYT? |
💚 Build Succeeded
History
To update your PR or re-run it, just comment with: |
LGTM 🎉 |
9196cbb
to
7782d45
Compare
@sqren can you review it, please? |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
@@ -133,6 +135,10 @@ export class Waterfall extends Component<Props> { | |||
const itemContainerHeight = 58; // TODO: This is a nasty way to calculate the height of the svg element. A better approach should be found | |||
const waterfallHeight = itemContainerHeight * waterfall.orderedItems.length; | |||
|
|||
const marks = waterfall.orderedItems.filter( | |||
item => item.docType === 'error' || item.docType === 'agentMark' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you ended up deciding not treating agentMark
as a docType
(because it's not) and just have it has custom payload inside transactions?
const serviceColors = getServiceColors(orderedItems); | ||
|
||
// the agentMarks should be added direct inside orderedItems, as it doesnt have parent-child relationship | ||
orderedItems.push(...getAgentMarks(entryTransaction)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused about the difference in implementation in this PR and #53756. Which one are you going for?
closes #45619
Show errors on timeline:

change the error badge style:
