serverless-sentry
Advanced tools
Comparing version 1.0.0-rc.2 to 1.0.0-rc.3
{ | ||
"name": "serverless-sentry", | ||
"version": "1.0.0-rc.2", | ||
"version": "1.0.0-rc.3", | ||
"description": "Serverless Sentry Plugin - Automatically send errors and exceptions to Sentry (https://sentry.io)", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -271,12 +271,13 @@ # ⚡️ Serverless Sentry Plugin | ||
dsn: https://xxxx:yyyy@sentry.io/zzzz # URL provided by Sentry | ||
organization: my-sentry-organziation | ||
project: my-sentry-project | ||
authToken: my-sentry-api-key | ||
release: git | ||
captureTimeoutWarnings: false # disable timeout warnings globally for all functions | ||
functions: | ||
HelloWorld: | ||
handler: hello.handler | ||
FuncFoo: | ||
handler: Foo.handler | ||
description: Hello World | ||
sentry: | ||
captureErrors: false # Disable error capturing for this specific function only | ||
captureTimeoutWarnings: true # Turn timeout warnings back on | ||
FuncBar: | ||
handler: Bar.handler | ||
sentry: false # completely turn off Sentry reporting | ||
``` | ||
@@ -331,5 +332,15 @@ | ||
### Raven throws an uncaught error: Cannot read property 'user' of undefined | ||
Raven is not initialized properly. If you're running in a local environment try | ||
setting the `filterLocal` option to `false`. | ||
## Version History | ||
### 1.0.0-rc.3 | ||
* Allow disabling Sentry for specific functions by settings `sentry: false` in | ||
the `serverless.yml`. | ||
* Added support for the [Serverless Offline Plugin](https://github.com/dherault/serverless-offline). | ||
### 1.0.0-rc.2 | ||
@@ -336,0 +347,0 @@ |
@@ -21,6 +21,25 @@ "use strict"; | ||
this.hooks = { | ||
"before:package:initialize": this.beforePackageInitialize.bind(this), | ||
"after:package:initialize": this.afterPackageInitialize.bind(this), | ||
"before:deploy:deploy": this.beforeDeployDeploy.bind(this), | ||
"after:deploy:deploy": this.afterDeployDeploy.bind(this) | ||
"before:package:initialize": () => BbPromise.bind(this) | ||
.then(this.validate), | ||
"after:package:initialize": () => BbPromise.bind(this) | ||
.then(this.setRelease) | ||
.then(this.instrumentFunctions), | ||
"before:deploy:deploy": () => BbPromise.bind(this) | ||
.then(this.validate), | ||
"after:deploy:deploy": () => BbPromise.bind(this) | ||
.then(this.createSentryRelease) | ||
.then(this.deploySentryRelease), | ||
"before:offline:start": () => BbPromise.bind(this) | ||
.then(this.validate) | ||
.then(this.setRelease) | ||
.then(this.instrumentFunctions), | ||
"before:offline:start:init": () => BbPromise.bind(this) | ||
.then(this.validate) | ||
.then(this.setRelease) | ||
.then(this.instrumentFunctions) | ||
}; | ||
@@ -76,24 +95,2 @@ | ||
beforePackageInitialize() { | ||
return BbPromise.bind(this) | ||
.then(this.validate); | ||
} | ||
afterPackageInitialize() { | ||
return BbPromise.bind(this) | ||
.then(this.setRelease) | ||
.then(this.instrumentFunctions); | ||
} | ||
beforeDeployDeploy() { | ||
return BbPromise.bind(this) | ||
.then(this.validate); | ||
} | ||
afterDeployDeploy() { | ||
return BbPromise.bind(this) | ||
.then(this.createSentryRelease) | ||
.then(this.deploySentryRelease); | ||
} | ||
instrumentFunctions() { | ||
@@ -107,3 +104,3 @@ // Get functions | ||
// Check if function should be instrumented | ||
return (_.get(functionObject, "sentry", true) === true); | ||
return (_.get(functionObject, "sentry", true) !== false); | ||
}) | ||
@@ -120,3 +117,7 @@ .then(functionObjects => { | ||
instrumentFunction(functionObject) { | ||
const sentryConfig = _.assign({}, this.sentry, _.get(functionObject, "sentry")); | ||
const sentryConfig = _.clone(this.sentry); | ||
const localConfig = _.get(functionObject, "sentry"); | ||
if (_.isPlainObject(localConfig)) { | ||
_.assign(sentryConfig, localConfig); | ||
} | ||
@@ -123,0 +124,0 @@ if (_.has(sentryConfig, "dsn")) { |
26611
361