mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
22 lines
439 B
JavaScript
22 lines
439 B
JavaScript
import { registerOTel } from '@vercel/otel'
|
|
|
|
export const onRequestError = async (err, request, context) => {
|
|
await fetch(`http://localhost:${process.env.PORT}/write-log`, {
|
|
method: 'POST',
|
|
body: JSON.stringify({
|
|
message: err.message,
|
|
request,
|
|
context,
|
|
}),
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
})
|
|
}
|
|
|
|
export function register() {
|
|
registerOTel({
|
|
serviceName: 'test',
|
|
})
|
|
}
|