@inspector-apm/inspector-nodejs

1.9.21 • Public • Published

Inspector | Code Execution Monitoring Tool

npm version npm downloads Contributor Covenant

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.

Dependents (1)

Package Sidebar

Install

npm i @inspector-apm/inspector-nodejs

Weekly Downloads

40

Version

1.9.21

License

ISC

Unpacked Size

43 kB

Total Files

25

Last publish

Collaborators

  • valerione
  • riktar