Install OpenLLMetry for Next.js by following these 3 easy steps and get instant monitoring.
Install the SDK
instrumentation.ts
in the root of your project (i.e., outside of the pages
or ‘app’ directory) and add the following code:An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled
To
resolve it, simply add "allowImportingTsExtensions": true
to your
tsconfig.jsoninstrumentation.node.ts
in the root of your project and add the following code:disableBatch
to true
.next.config.js
:Annotate your workflows
withWorkflow()
function call.We also have compatible Typescript decorators for class methods which are more convenient.Configure trace exporting
TRACELOOP_API_KEY
and TRACELOOP_BASE_URL
.For Traceloop, read on. For other options, see Exporting.TRACELOOP_API_KEY
.Done! You’ll get instant visibility into everything that’s happening with your LLM.
If you’re calling a vector DB, or any other external service or database, you’ll also see it in the Traceloop dashboard.