Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/no9/nodejs-express-trace
An appsody stack based on nodejs express with dynamic tracing
https://github.com/no9/nodejs-express-trace
Last synced: 5 days ago
JSON representation
An appsody stack based on nodejs express with dynamic tracing
- Host: GitHub
- URL: https://github.com/no9/nodejs-express-trace
- Owner: No9
- License: mit
- Created: 2019-07-17T21:19:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T18:16:52.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T06:06:30.400Z (about 2 months ago)
- Language: JavaScript
- Size: 206 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nodejs-express-trace
An appsody stack based on [nodejs-express](https://github.com/appsody/stacks/tree/master/incubator/nodejs-express) with dynamic tracingThis project provides USDT support to an express app to enable dynamic tracing of User Statically Defined Tracing points in your express application. This allows for better debugging experience in production environments.
### usage
Create a trace enabled node.js project.
```
$ mkdir my-app
$ cd my-app
$ appsody init nodejs-express
```In the project app.js add a trace event
```
const app = require('express')()app.get('/event', function (req, res, next) {
res.trace('some.event', 'some event data');
res.send("Hello from Appsody!");
});
module.exports.app = app;
```Run the project
```
$ appsody run
```As root trace the requests with bpftrace
```
$ sudo bpftrace -p `pgrep node` -e 'usdt::trace { printf("evt:fired %s : %s\n", str(arg0), str(arg1)) ; }'
```