Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
 
 

README.md

Outline

Sentry

Official Sentry SDK for Google Cloud Functions

Links

General

This package is a wrapper around @sentry/node, with added functionality related to various Serverless solutions. All methods available in @sentry/node can be imported from @sentry/google-cloud-serverless.

To use this SDK, call Sentry.init(options) at the very beginning of your JavaScript file.

const Sentry = require('@sentry/google-cloud-serverless');

Sentry.init({
  dsn: '__DSN__',
  tracesSampleRate: 1.0,
  // ...
});

// For HTTP Functions:

exports.helloHttp = Sentry.wrapHttpFunction((req, res) => {
  throw new Error('oh, hello there!');
});

// For Background Functions:

exports.helloEvents = Sentry.wrapEventFunction((data, context, callback) => {
  throw new Error('oh, hello there!');
});

// For CloudEvents:

exports.helloEvents = Sentry.wrapCloudEventFunction((context, callback) => {
  throw new Error('oh, hello there!');
});
Morty Proxy This is a proxified and sanitized view of the page, visit original site.