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

feat(me): implement timing events for spans #2995

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

tomhoule
Copy link
Contributor

@tomhoule tomhoule commented Jun 21, 2022

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

@tomhoule tomhoule added this to the 4.0.x milestone Jun 21, 2022
@tomhoule tomhoule force-pushed the migration-engine/minimal-timings branch from d70105f to cd1ed5c Compare June 21, 2022 12:17
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
@tomhoule tomhoule force-pushed the migration-engine/minimal-timings branch from cd1ed5c to 2f40772 Compare June 21, 2022 12:24
@tomhoule tomhoule marked this pull request as ready for review June 21, 2022 12:30
@tomhoule tomhoule requested a review from a team as a code owner June 21, 2022 12:30
}
}
))
.await?
Copy link
Contributor Author

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);
Copy link
Contributor Author

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

Copy link
Contributor

@pimeys pimeys left a 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

@tomhoule
Copy link
Contributor Author

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.

@tomhoule tomhoule merged commit 40cc1bd into main Jun 21, 2022
@tomhoule tomhoule deleted the migration-engine/minimal-timings branch June 21, 2022 14:45
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.

Migrate internal duration/performance logging
2 participants