Integrate OpenTelemetry for Nest.js with infrastack.ai
Learn how to instrument your Nest.js application with infrastack.ai and OpenTelemetry for comprehensive observability and performance insights.
What you will learn
- How to set up your environment
- How to your application using the infrastack.ai SDK or the official OpenTelemetry SDK
Prerequisites
- An infrastack.ai account to get your API key
- A Nest.js application
Getting started
You can use the Infrastack SDK to instrument your Nest.js application with a single line of code.
Install the NPM package
Prepare your environment
Export your API key as an environment variable.
.env
file by using the dotenv library.Create instrumentation.ts
Create an instrumentation.ts
file under the src
folder.
Import the instrumentation module in your main.ts file
Run your application
Run your Nest.js application with the default Nest.js command.
You can use the Infrastack SDK to instrument your Nest.js application with a single line of code.
Install the NPM package
Prepare your environment
Export your API key as an environment variable.
.env
file by using the dotenv library.Create instrumentation.ts
Create an instrumentation.ts
file under the src
folder.
Import the instrumentation module in your main.ts file
Run your application
Run your Nest.js application with the default Nest.js command.
You can use the OpenTelemetry Javascript SDK to instrument your Nest.js application.
Install the NPM packages
Prepare your environment
.env
file by using the dotenv library.Create instrumentation.ts
Here, you will create a file that will be used to instrument your application. You will have lower level control over the instrumentation process.
Import the instrumentation module in your main.ts file
Run your application
Run your Nest.js application with the default Nest.js command.