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

Total Trace Duration - sum of span times #17

Closed
danstarns opened this issue Sep 3, 2023 · 4 comments
Closed

Total Trace Duration - sum of span times #17

danstarns opened this issue Sep 3, 2023 · 4 comments
Assignees
Labels

Comments

@danstarns
Copy link
Member

danstarns commented Sep 3, 2023

Problem

The Trace time should be the total sum of all the durations for each span in the trace.

Given the screenshot debugger shows that listTraceGroups takes 1 ms, however, it should be 63 ms being the sum of all the span durations.

Screenshot 2023-09-18 at 15 47 42
@danstarns danstarns added the time label Sep 3, 2023
@danstarns danstarns mentioned this issue Sep 3, 2023
@Tohaker Tohaker self-assigned this Sep 18, 2023
@Tohaker
Copy link
Collaborator

Tohaker commented Sep 18, 2023

@danstarns Could you clarify the issue? I assume you're talking about the first Span in the Trace Viewer not expanding all the way across right?
image

I believe this is actually the correct behaviour; the listSchemas query in this case is recording the time spent in the root level query (in this example, packages/graphql-schema/src/queries/list-schemas.ts) and the further traces refer to the very simple, yet still present, field resolvers for the schemas field. As these are merely JS lookups, it's no surprise they take microseconds to resolve, however the 11ms in listSchemas will be the Prisma query, which is bound to take a long time and that's before the schema has even begun to resolve the schemas field.

Please let me know if I have the wrong end of the stick here, but I'm tempted to say "its a feature" 😄

@danstarns danstarns changed the title Trace Duration Total Trace Duration - sum of span times Sep 18, 2023
@danstarns
Copy link
Member Author

@Tohaker I updated the description of this issue, please let me know if you need more clarification.

@Tohaker
Copy link
Collaborator

Tohaker commented Sep 19, 2023

Thanks Dan, I definitely misunderstood 😅 that issue can definitely be fixed

@danstarns
Copy link
Member Author

Fixed, tested and released in alpha-62.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants