Next.js Discord

Discord Forum

How can I log the time taken for a page to fully render during server-side (SSR) in Next.js

Answered
Short mackerel posted this in #help-forum
Open in Discord
Short mackerelOP
I'm trying to measure and log the total time it takes for a page to complete rendering on the server (SSR) in a Next.js application. What’s the best way to do this — ideally capturing the time from when the request hits the server until the HTML is fully generated?

I am using app router and I have api calls in my child component.

Any guidance or recommended approach would be appreciated!
Answered by Asian black bear
The most reliable way to profile your application is using OTel instrumentation: https://nextjs.org/docs/app/guides/open-telemetry
View full answer

3 Replies

Original message was deleted
Short mackerelOP
Thank you, I need the exact time for SSR please.
@Short mackerel Thank you, I need the exact time for SSR please.
Asian black bear
The person who posted the response was blatantly using ChatGPT responses that were even wrong.
Asian black bear
The most reliable way to profile your application is using OTel instrumentation: https://nextjs.org/docs/app/guides/open-telemetry
Answer