Next.js · Senior · Question 19 of 75

What is the instrumentation.ts file with a register() function for?

Explanation

register is called when a new server instance starts - suitable for initializing tracing, monitoring and logging. onRequestError lets you send server errors to a monitoring system. For the client side there's instrumentation-client.ts.

Further reading

Problem with a question

Next.js · Senior · question 19

Test yourself

Take the Next.js · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz