-
Notifications
You must be signed in to change notification settings - Fork 212
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(me): implement timing events for spans #2995
Conversation
d70105f
to
cd1ed5c
Compare
This is a minimal tracing layer that times how long each span takes and logs an event with the result after the span is closed, for our own needs in performance observability. closes prisma/prisma#13693
cd1ed5c
to
2f40772
Compare
} | ||
} | ||
)) | ||
.await? |
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.
indentation change, pretty much. span.enter()
does not interact well with async and the replacement requires one level of identation more
#[derive(Default)] | ||
pub struct TimingsLayer; | ||
|
||
struct TimerTime(pub time::Instant, String); |
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.
the pub
can/should go
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.
Are you sure about the microseconds :D
Yes it's a bit ridiculous when network is involved, but it's not always the case, and we display a human-readable version of the duration next to it, so I still think it's the right choice. |
This is a minimal tracing layer that times how long each span takes and
logs an event with the result after the span is closed, for our own
needs in performance observability.
closes prisma/prisma#13693