serverless-sentry-lib
serverless-sentry-lib copied to clipboard
Sentry performance monitoring through @sentry/tracing
Thanks for your work on serverless-sentry-* ❤️
Sentry now offers performance monitoring through @sentry/tracing, and using it is a breeze. How about integrating it?
Extracts from Sentry onboarding : start by adding @sentry/tracing as a dependency:
# Using yarn
yarn add @sentry/node @sentry/tracing
# Using npm
npm install --save @sentry/node @sentry/tracing
Capture both error and performance data:
const Sentry = require("@sentry/node");
// or use es6 import statements
// import * as Sentry from '@sentry/node';
const Tracing = require("@sentry/tracing");
// or use es6 import statements
// import * as Tracing from '@sentry/tracing';
Sentry.init({
dsn: "you know what to put there,
// We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: 1.0,
});
const transaction = Sentry.startTransaction({
op: "test",
name: "My First Test Transaction",
});
setTimeout(() => {
try {
foo();
} catch (e) {
Sentry.captureException(e);
} finally {
transaction.finish();
}
}, 99);
More info here: https://docs.sentry.io/platforms/node/#monitor-performance
@arabold is there any intention from you to add this functionality? If not, I could attempt this if I get the time