Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inspector-apm/inspector-nodejs
Connect your nodejs, express, fastify application to Inspector monitoring dashboard.
https://github.com/inspector-apm/inspector-nodejs
inspector inspector-nodejs monitoring nodejs-applications nodejs-backend-applications
Last synced: 2 months ago
JSON representation
Connect your nodejs, express, fastify application to Inspector monitoring dashboard.
- Host: GitHub
- URL: https://github.com/inspector-apm/inspector-nodejs
- Owner: inspector-apm
- License: mit
- Created: 2020-04-18T14:45:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-31T16:45:13.000Z (5 months ago)
- Last Synced: 2024-11-03T19:37:55.864Z (2 months ago)
- Topics: inspector, inspector-nodejs, monitoring, nodejs-applications, nodejs-backend-applications
- Language: JavaScript
- Homepage: https://www.inspector.dev
- Size: 699 KB
- Stars: 4
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Inspector | Code Execution Monitoring Tool
[![npm version](https://badge.fury.io/js/@inspector-apm%2Finspector-nodejs.svg)](https://badge.fury.io/js/@inspector-apm%2Finspector-nodejs)
[![npm downloads](https://img.shields.io/npm/dt/@inspector-apm/inspector-nodejs)](https://www.npmjs.com/package/@inspector-apm/inspector-nodejs)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)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](https://www.inspector.dev).
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.
```javascript
/*
* 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:
- [ExpressJs](https://docs.inspector.dev/guides/get-started-with-express)
- [Fastify](https://docs.inspector.dev/guides/fastify)## Official Documentation
**[Go to the official documentation](https://docs.inspector.dev/platforms/nodejs)**
## Contributing
We encourage you to contribute to Inspector! Please check out the [Contribution Guidelines](CONTRIBUTING.md) about how to proceed. Join us!
## LICENSE
This package is licensed under the [MIT](LICENSE) license.