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

Stack Trace and Breadcrumbs table polish #112

Merged
merged 3 commits into from
Nov 21, 2023

Conversation

svc-shorpo
Copy link
Contributor

@svc-shorpo svc-shorpo commented Nov 19, 2023

Log Side Panel polish

Screenshot 2023-11-18 at 6 13 26 PM

Screenshot 2023-11-18 at 6 13 11 PM

Screenshot 2023-11-18 at 6 12 00 PM

Screen.Recording.2023-11-18.at.6.12.03.PM.mov

Screenshot 2023-11-18 at 6 11 33 PM

Copy link

changeset-bot bot commented Nov 19, 2023

🦋 Changeset detected

Latest commit: ec9bf7b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hyperdx/app Minor
@hyperdx/api Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

MikeShi42
MikeShi42 previously approved these changes Nov 19, 2023
Copy link
Contributor

@MikeShi42 MikeShi42 left a comment

Choose a reason for hiding this comment

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

Mainly just style thoughts, two other things:

Do you think we can switch displayedTab in the LogSidePanel to show the trace view if it's an exception by default? The parsed property tab is still kind of useful (mainly for us for debugging I suspect 😅) but the trace view is much better.

Minor scope creep, do you think you could add a ?? '[]' fallback case in the <ExceptionSubpanel breadcrumbs={JSON.parse... call? It looks like those properties might not exist sometimes.

https://github.com/hyperdxio/hyperdx/pull/112/files#diff-5f55b5edc12310ed29646b1473a4351297d3aafef28cb4a1b4288084c18ef632L657-L670

I can create a follow up ticket otherwise.

tr {
td {
padding: 6px 12px;
border-bottom: 1px solid $slate-950;
Copy link
Contributor

Choose a reason for hiding this comment

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

thoughts on leaving out the border for some of the network panel stuff? it feels a bit cleaner/less busy
image

};

export const StacktraceRow = ({ row }: { row: Row<StacktraceFrame> }) => {
const [lineContextOpen, setLineContextOpen] = React.useState(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's a bit more intuitive to have the line context open (as it feels like the most helpful part!)

<Table
hideHeader
columns={stacktraceColumns}
data={firstException.stacktrace?.frames ?? []}
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should reverse the frames here so that the more specific and likely user-land code is on top?
image

</CollapsibleSection>

<CollapsibleSection title="Breadcrumbs" initiallyCollapsed>
Copy link
Contributor

Choose a reason for hiding this comment

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

I also think it'd be nice if this was default open

header: 'Message',
size: UNDEFINED_WIDTH,
cell: ({ row }) =>
row.original.message || <span className="text-slate-500">Empty</span>,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd be nice here if can also make use of the fetch/xhr categories, as they currently show up as empty (maybe a follow up PR?) Here's a few examples if helpful of the data structure I see:

{
  "category": "fetch",
  "data": {
    "method": "GET",
    "status_code": 200,
    "url": "http://localhost:8080/__nextjs_original-stack-frame"
  },
  "timestamp": 1700379487.918,
  "type": "http"
}
{
  "category": "xhr",
  "data": {
    "method": "POST",
    "status_code": 200,
    "url": "http://localhost:4318/v1/traces"
  },
  "timestamp": 1700379491.015,
  "type": "http"
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll do it in a separate pr

@@ -0,0 +1,333 @@
import * as React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious how do we differentiate what should belong here vs LogSidePanel? Is this like a generic util elements for the LogSidePanel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, that's the idea

Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops, removed

Copy link
Contributor

@MikeShi42 MikeShi42 left a comment

Choose a reason for hiding this comment

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

I'm assuming we'll leave changing displayedTab to trace for exceptions for a follow up PR as well?

'breadcrumbs',
)
],
) ?? []
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually I believe in this case we need to do

JSON.parse(
selectedLogData?.['string.values']?.[
  selectedLogData?.['string.names']?.indexOf(
    'breadcrumbs',
  )
] ?? '[]')

as the undefined value into JSON.parse will throw a parse error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point. moved JSON.parse calls into separate memo'd consts with try/catch block just in case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm assuming we'll leave changing displayedTab to trace for exceptions for a follow up PR as well?

yes, will do in a separate PR, this one already becomes a bit unwieldy :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made changes here: #118

Copy link
Contributor

@MikeShi42 MikeShi42 left a comment

Choose a reason for hiding this comment

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

🚢🚢🚢

@svc-shorpo svc-shorpo merged commit 9c2e279 into hyperdxio:main Nov 21, 2023
3 checks passed
@svc-shorpo svc-shorpo deleted the sentry branch November 21, 2023 05:43
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.

None yet

2 participants