Skip to content
Instrumentation library for Node.js 6.10, 8.10 and 10.x ⚡️
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
scripts
src fix(http.js): don't extract data on Wreck request (#92) May 22, 2019
test
.eslintignore feat(labels): support custom labels in traces Dec 20, 2018
.eslintrc Initial commit. Oct 3, 2018
.gitignore Initial commit. Oct 3, 2018
.npmignore Initial commit. Oct 3, 2018
.travis.yml
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md (#11) Nov 15, 2018
LICENSE Initial commit. Oct 3, 2018
README.md feat(frameworks): fork out frameworks (#91) May 19, 2019
commitlint.config.js Initial commit. Oct 3, 2018
package-lock.json
package.json feat(frameworks): fork out frameworks (#91) May 19, 2019
rollup.config.js

README.md

Epsagon Instrumentation for Node.js

Build Status npm version semantic-release

This package provides an instrumentation to Node.js code running on functions for collection of distributed tracing and performance monitoring.

Installation

From your project directory:

npm install --save epsagon

Getting started

Simply use the wrapper to send traces from your code:

const epsagon = require('epsagon');
epsagon.init({
    token: 'my-secret-token',
    appName: 'my-app-name',
    metadataOnly: false, // Optional, send more trace data
});

function handler(event, context, callback) {
    callback(null, 'It worked!')
}

handler = epsagon.lambdaWrapper(handler)

Custom labels

You can add custom labels to your traces. Filters can later be used for filtering traces that contains specific labels:

function handler(event, context, callback) {
    epsagon.label('myCustomLabel', 'labelValue');
    callback(null, 'It worked!')
}

Custom errors

You can set a trace as an error (although handled correctly) by catching an error:

function handler(event, context, callback) {
    try {
        // something bad happens
    } catch (err) {
        epsagon.setError(err);
    }

    callback(null, 'It worked!')
}

Or manually specify Error object:

function handler(event, context, callback) {
    epsagon.setError(Error('My custom error'));
    callback(null, 'It worked!')
}

Web frameworks

Support for Express, Hapi, and other frameworks is done through epsagon-frameworks

Copyright

Provided under the MIT license. See LICENSE for details.

Copyright 2019, Epsagon

You can’t perform that action at this time.