Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TrackJs/TrackJS-Node
TrackJS Error Monitoring agent for NodeJS
https://github.com/TrackJs/TrackJS-Node
debugger debugging debugging-tool error error-handling error-monitoring error-reporting javascript logging nodejs trackjs trackjs-agent trackjs-node
Last synced: 3 months ago
JSON representation
TrackJS Error Monitoring agent for NodeJS
- Host: GitHub
- URL: https://github.com/TrackJs/TrackJS-Node
- Owner: TrackJs
- License: other
- Created: 2019-06-12T22:32:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-04T14:19:30.000Z (5 months ago)
- Last Synced: 2024-10-28T16:12:51.190Z (3 months ago)
- Topics: debugger, debugging, debugging-tool, error, error-handling, error-monitoring, error-reporting, javascript, logging, nodejs, trackjs, trackjs-agent, trackjs-node
- Language: TypeScript
- Homepage: https://trackjs.com/
- Size: 289 KB
- Stars: 31
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# TrackJS Agent for NodeJS
## Reference
- [TrackJS NodeJS Documentation](https://docs.trackjs.com/node-agent/installation/)
## Usage
To use the Agent, call `TrackJS.install(options)` as soon as possible in your code. It will install the monitors into the environment.
```javascript
// ES5
const TrackJS = require("trackjs-node").TrackJS;
// ES6
import { TrackJS } from "trackjs-node";TrackJS.install({
token: "YOUR_TOKEN"
/* other options */
});
```To add more context to your errors, add context and metadata through the agent.
```javascript
TrackJS.configure({
sessionId: "session",
version: "1.0.0",
userId: "[email protected]"
});// or add arbitrary keys for whatever you think is important
TrackJS.addMetadata({
foo: "bar"
});
```TrackJS will automatically gather Telemetry and send errors. If you want to trigger these events yourself, you can.
```javascript
TrackJS.addLogTelemetry("warn", [
"a warning message",
{
/*state object*/
}
]);TrackJS.track(new Error("everything has gone wrong!"));
```