@inspector-apm/inspector-nodejs
v1.9.21
Published
Real-Time monitoring for NodeJS Applications
Downloads
185
Readme
Inspector | Code Execution Monitoring Tool
Simple code execution monitoring for NodeJs backend applications.
Install
Install the latest version via npm:
npm install @inspector-apm/inspector-nodejs --save
Configure the Ingestion Key
You need an Ingestion Key to create an Inspector instance. You can obtain a key creating a new project in your dashboard.
If you use dotenv
you can configure the Ingestion Key in your environment file:
INSPECTOR_INGESTION_KEY=[ingestion key]
Integrate in your code
Inspector must be initialized before you require any other modules - i.e. before, express
, http
, mysql
, etc.
/*
* Initialize Inspector with the Ingestion Key.
*/
const inspector = require('@inspector-apm/inspector-nodejs')({
ingestionKey: 'xxxxxxxxxxxxx',
})
const app = require('express')()
/*
* Attach the middleware to monitor HTTP requests fulfillment.
*/
app.use(inspector.expressMiddleware())
app.get('/', function (req, res) {
return res.send('Home Page!')
})
app.get('/posts/:id', function (req, res) {
return res.send('Single Post Details!')
})
app.listen(3006)
Inspector will monitor your code execution in real time, alerting you if something goes wrong.
Supported frameworks:
Official Documentation
Go to the official documentation
Contributing
We encourage you to contribute to Inspector! Please check out the Contribution Guidelines about how to proceed. Join us!
LICENSE
This package is licensed under the MIT license.