-
Notifications
You must be signed in to change notification settings - Fork 228
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
feat: add correlate span logs in traces waterfall chart #605
base: v2
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: a868d77 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
- Support searching coorelate span log in trace windows Ref: hdx-1181
e8fc4a9
to
7c2c758
Compare
@@ -202,7 +204,14 @@ export default function DBTracePanel({ | |||
<Text size="sm" c="dark.2" my="sm"> | |||
Span Details |
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 should reflect the correct event type 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.
Not sure which part you mean, do you mean Span Details
?
@@ -56,7 +57,7 @@ export default function DBTracePanel({ | |||
|
|||
const [traceRowWhere, setTraceRowWhere] = useQueryState( | |||
'traceRowWhere', |
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.
not a huge fan of overloading this query param, esp if the rowWhere is for a log but put in the "traceRowWhere" - the naming wouldn't make sense.
I think it might be better to introduce another query param for logRowWhere
? We could rename this query param but it'd technically be a breaking change (technically this schema change is already a breaking change, URLs are supposed to be stable in our app).
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.
Yeah, I agree with you we should not overload traceRowWhere
, it should only return trace relate param, however I think it is a little too overcomplicate to make two queryState for returning focus param.
I think I will change the name to spanRowWhere
, it makes more sense since span can be log or trace.
packages/common-utils/src/types.ts
Outdated
@@ -73,6 +73,7 @@ export const SelectListSchema = z.array(DerivedColumnSchema).or(z.string()); | |||
export const SortSpecificationSchema = z.intersection( | |||
RootValueExpressionSchema, | |||
z.object({ | |||
valueExpression: z.string().optional(), |
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.
why do we need to add this?
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 get mentioned in lint
error,
usually ordering will need to mention column, example:
orderBy: [
{
valueExpression: config.timestampValueExpression,
ordering: 'ASC',
},
],
I am fine to revert this, because I don't think I need order
query anymore(data need to sort after fetching anyway).
// If there's no parent defined, or if the parent doesn't exist, we're a root | ||
(result.ParentSpanId === '' || !spanIds.has(result.ParentSpanId)) | ||
) { | ||
const isRootNode = |
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 believe this can be a lot more readable if we do the direct boolean expression which I believe is:
const isRootNode = HyperDXEventType === 'span' && type !== SourceKind.Log && !nodeParentSpanId;
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.
oh cool, good call on this. Also since I am removing HyperDXEventType
, this will become:
// root if is trace event and has no parent
const isRootNode = type === SourceKind.Trace && !nodeParentSpanId;
if (type === SourceKind.Log) logSpanCount += 1; | ||
|
||
// log have dupelicate span id, tag it with -log-couunt | ||
const nodeSpanId = |
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.
is this id used anywhere? is it effectively just random and never used further?
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 uses as ref key to get node, it only use for trace event. And for log event, I add -log-count
to prevent it overwrite trace event node.
And the reason is, in trace table, all spanId
is unique, but in log table, spanId
can be duplicate and it is a reference to trace event(more like parentSpanId
).
SeverityText: warn
will display as color yellowLog Tab:
![Screenshot 2025-02-10 at 8 58 40 AM](https://private-user-images.githubusercontent.com/14082239/411667990-837de0cc-6ec3-456d-9251-5f05697d6343.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTMwNTYsIm5iZiI6MTczOTYxMjc1NiwicGF0aCI6Ii8xNDA4MjIzOS80MTE2Njc5OTAtODM3ZGUwY2MtNmVjMy00NTZkLTkyNTEtNWYwNTY5N2Q2MzQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA5NDU1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVjNzMxOTkzYzZiY2E2Yzg0MmQyNGFiMzE5NjY1ZjJjOWU3OTEzMWM3ODk0NDM0ZDdkZDJmMzU0YWIxM2MzNjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.U23S4Rupja5Hi0Evsji4pigJBnPiGCDkRzde0H71suM)
Trace Tab:
![image](https://private-user-images.githubusercontent.com/14082239/413007589-025613da-8efd-44ee-9258-a49c6ee84cb5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTMwNTYsIm5iZiI6MTczOTYxMjc1NiwicGF0aCI6Ii8xNDA4MjIzOS80MTMwMDc1ODktMDI1NjEzZGEtOGVmZC00NGVlLTkyNTgtYTQ5YzZlZTg0Y2I1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA5NDU1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc0ZGY5ZTY3ZTNmN2FjNWQ0ZTZhZWVlMDU3NjI3OTVmMDJiZmJkOGViNzkyYjc2OWVjZjA0NGIyNTg5ZTE1MGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pZD55zC288gZRrMn2fPkbAjbIVKeurojgyHflpjAm2U)
Ref: hdx-1181