arabold / serverless-sentry-plugin Goto Github PK
View Code? Open in Web Editor NEWThis plugin adds automatic forwarding of errors and exceptions to Sentry (https://sentry.io) and Serverless (https://serverless.com)
License: MIT License
This plugin adds automatic forwarding of errors and exceptions to Sentry (https://sentry.io) and Serverless (https://serverless.com)
License: MIT License
Environment variable SENTRY_CAPTURE_ERRORS must contain string
Any thoughts? We have added the config value in YML and also set the env var manually without any luck
We should encrypt at least the DSN when setting the environment variables. This would have to be supported in the platform specific libraries as well.
Hello!
We started to getting "too many requests" error from Sentry after last update.
"You are attempting to use this endpoint too frequently. Limit is 40 requests in 1 seconds"
I can assume it may happen because of latest change 5140c0d
Two things I can propose here:
For me concurrency 5 was reasonable default, why it was changed to 50, did it really give meaningful performance gain?
Hi,
Any chance you could release 1.0.0-rc.4
from master?
I need the "use strict";
at the top of src/git-rev.js
and this isn't in the latest release.
This is my endpoint code (using Serverless Framework):
import serverless from 'serverless-http';
import app from './app'; // express app
import withSentry from 'serverless-sentry-lib';
export const handler = withSentry(serverless(app));
I figured this would work since this plugin is meant for serverless, but unfortunately it doesn't handle unexpected/uncaught errors. Is there something else I need to do?
Additionally to warn as soon as half of the available timeout time has been used, it would be also critical to add an automatic warning, when 3/4 or some other configurable percentage of the provided lambda memory has been consumed, as it's hard to find out if the assigned memory is nearing the limit over time.
This happens especially when using Babel or other transformations that change their behavior on updates and create faster but more memory hungry code.
Hi,
A few days from now we started to get this error on our pipelines:
Error ---------------------------------------------------
Error: Sentry: Error uploading sourcemap file - Error: connect EADDRNOTAVAIL 35.188.42.15:443 - Local (172.17.0.2:0)
at SentryPlugin.<anonymous> (/builds/services/node_modules/serverless-sentry/dist/index.js:603:31)
at step (/builds/services/node_modules/serverless-sentry/dist/index.js:44:23)
at Object.throw (/builds/services/node_modules/serverless-sentry/dist/index.js:25:53)
at rejected (/builds/services/node_modules/serverless-sentry/dist/index.js:17:65)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: linux
Node Version: 14.19.3
Framework Version: 2.72.3 (local)
Plugin Version: 5.5.4
SDK Version: 4.3.2
Components Version: 3.18.2
This is what our dependencies look like at the moment:
"@sentry/integrations": "^7.2.0",
"@sentry/node": "^7.2.0",
"serverless-sentry-lib": "^2.5.0",
"serverless-sentry": "^2.5.0",
We even tried to disable this functionality by adding the environment variable SENTRY_SOURCEMAPS
or adding the custom config:
sentry:
sourceMaps: false
But it runs regardless and ignores the flag. Do you have any idea what is happening and how to work around this?
Hi,
Just wondering if anyone has managed to get source map uploads to sentry working when using ts, and serverless-plugin-typescript to build and deploy ts lambdas. Serverless plugin typescript temporarily creates its outputs in a .build directory but I think this may be deleted after the packaing
phase completes in sls and before the sentry plugin runs.
If I deploy all project sls deploy -s mystage
it works fine as expected.
However, if I try to deploy only one function with sls deploy function -f myfunction -s mystage
I am getting an error Error: Invalid filename
on node_modules/adm-zip/adm-zip.js:57:19
caused by this line
serverless-sentry-plugin/src/index.ts
Line 459 in b0dd2d1
Because file .serverless/myFunction.zip
doesn't exist. In fact, whole directory is cleaned (dropped) when I run sls deploy function
.
Serverless version 3.10.1, sentry plugin 2.5.3.
I guess it should work the following - if file exists, reuse it, if not - build and pack it (and only one function). (I use package.individually = true
and serverless-bundle plugin).
Seems that serverless-bundle plugin uses serverless-webpack under the hood and I have checked that during sls deploy function
command a ZIP file inside directory .serverless
is actually created... however after that it is deleted before hook of sentry-plugin is called... I am still not sure which issue is it exactly, which of the plugin or the framework itself...
Hi, I've followed the instructions and installed the plugin on Lambda.
However, when I then trigger a very obvious error, it's not picked up in Sentry.
Here's my code:
'use strict';
const SparkPost = require('sparkpost');
const { decrypt, } = require('../crypto.js');
const RavenLambdaWrapper = require("serverless-sentry-lib");
// Wrap handler for automated error and exception logging
const ravenConfig = {
captureErrors: true,
captureUnhandledRejections: true,
captureMemoryWarnings: true,
captureTimeoutWarnings: true,
ravenClient: require("raven") // don't forget!
};
module.exports.index = RavenLambdaWrapper.handler(ravenConfig, (event, context, callback) => {
context.callbackWaitsForEmptyEventLoop = true;
const keys = event.requestContext.authorizer;
const body = JSON.parse(event.body);
console.log('event', JSON.stringify(body, 3));
const response = {
statusCode: 200,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Credentials': true,
},
body: '',
};
const client = new SparkPost(keys.SparkPostKey);
const RECIPIENT = body.RECIPIENT;
const TEMPLATE_ID = body.TEMPLATE_ID;
const CAMPAIGN_ID = body.CAMPAIGN_ID;
const SUBSTITUTION_DATA = body.SUBSTITUTION_DATA;
try {
if (SUBSTITUTION_DATA && SUBSTITUTION_DATA.confirmation_link) {
SUBSTITUTION_DATA.confirmation_link = decrypt(SUBSTITUTION_DATA.confirmation_link);
}
} catch (err) {
console.log('to decryption err', err);
response.statusCode = 400;
response.body = JSON.stringify({
status: 'Failed',
error: 'Decryption error in \'confirmation_link\'',
});
return callback(null, response);
}
client.transmissions.send({
options: {
track_opens: true,
track_clicks: true,
transactional: true,
ip_pool: "trans2"
},
campaign_id: CAMPAIGN_ID,
content: {
template_id: TEMPLATE_ID
},
substitution_data: SUBSTITUTION_DATA,
recipients: RECIPIENT
})
.then(data => {
console.log("Email has been sent. ", data);
response.body = JSON.stringify({
success: true,
data: data,
});
callback(null, response);
})
.catch(err => {
console.log(err);
response.statusCode = 400;
response.body = JSON.stringify({
success: false,
error: err,
});
callback(null, response);
});
});
This is my serverless.yml file
service: saas-service
plugins:
- serverless-webpack
- serverless-sentry
provider:
name: aws
runtime: nodejs8.10
region: ${self:custom.environment.AwsRegion}
stage: ${opt:stage}
timeout: 30
memorySize: 512
custom:
environment: ${file(./config.json):${opt:stage}}
webpack:
webpackConfig: webpack.config.js
includeModules:
forceExclude:
- aws-sdk
- crypto
sentry:
dsn: https://[email protected]/YYY # URL provided by Sentry
functions:
Authorizer:
handler: functions/authorizer/authorizer.index
environment:
Environment: ${opt:stage}
ConfirmationEmail:
handler: functions/mail/confirmation_email.index
events:
- http:
path: confirmation_email/
method: post
cors: true
authorizer:
name: Authorizer
resultTtlInSeconds: 0
identitySource: method.request.header.Authorization
type: token
environment:
Environment: ${opt:stage}
resources:
Resources:
GatewayResponseDefault4XX:
Type: 'AWS::ApiGateway::GatewayResponse'
Properties:
ResponseParameters:
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
ResponseType: DEFAULT_4XX
RestApiId:
Ref: 'ApiGatewayRestApi'
If I send a wrong SUBSTITUTION_DATA.confirmation_link the Lambda functions breaks (correctly) and I can see the log in CloudWatch, but Sentry doesn't pick anything up.
Ideas?
Great Plugin! I would like to ability to set options in the custom
object in s-project.json
instead of s-function.json
Any guidance on how to do this?
We'd like to use CaptureConsole in our lambdas, but I don't see that as an option in type SentryOptions
https://docs.sentry.io/platforms/javascript/configuration/integrations/plugin/#captureconsole
I have repository in Gitlab called [email protected]:org/group/subgroup/project.git
.
When trying to use the plugin with releases configuration I am bad request from Sentry with similar message
{"refs":["Invalid repository names: subgroup / project"]}
Seems it's because of regular expression here
serverless-sentry-plugin/src/index.ts
Line 325 in 8c60ea5
I am not sure what was the motivation for such capturing group as ([^/]+\/[^/]+?)
, so me just putting (.+?)
is enough and works... this expression allows only one /
symbol, though it may be few of them in between. What I need is to extract full repository name like org/group/subgroup/project
.
Is it a bug? Seems that putting repository name manually into serverless.yaml
fixes it.
Any chance of getting this to work with the latest serverless?
I am trying to integrate Sentry with serverless:
Serverless Version:
Framework Core: 3.1.0 Plugin: 6.0.0 SDK: 4.3.0
Serverless Sentry Plugin Version:
Production Dependency:
"serverless-sentry-lib": "^2.4.0", "@sentry/node": "^6.17.9"
Dev Dependency:
"serverless-sentry": "^2.4.0",
It returns the following error:
At least one of the plugins defines a validation schema that is invalid. Try disabling plugins one by one to identify the problematic plugin and report it to the plugin maintainers.
If I remove the sentry plugin then it works fine.
I would like to use git
versions, but I can't since it populates automatically the refs
option. My problem is that we're not using Github, but a private Gitlab (sob). So the configuration is rejected by Sentry saying it doesn't know the related Github repo.
Serverless: Sentry: Creating new release "v0.23.0-rc1"...
Serverless: Sentry: Received error response from Sentry:
{"refs": ["Invalid repository names: my_company/my_repo"]}
refs
- If you have set up Sentry to collect commit data, you can use commit refs to associate your commits with your Sentry releases. Refer to the Sentry Documentation for details about how to use commit refs. If you set your version to git (or true), the refs options are populated automatically and don't need to be set.
Is there a way to enable the git
version feature (i.e. using the git commit hash or version if any) without populating the refs ?
In case of a function timeout the information provided is very modest.
The information is as follows:
{ Records: [ [Object] ] }
It would be good to see the whole output as a string, is there a way to do so?
Thank you! Alex
Are there still plans to work on this? If one of the repo maintainers wants to work together on this, I'm game. Right now I have to decide between using this plugin (which rocks), or the SentryWebpackPlugin
(not quite as good) which does upload source maps.
Thank you for using a great plugin for error detection in Lambda functions via Sentry.
However, there seems to be a problem with the Releases part of the READ.me file.
I am wondering if it is correct to have a -
character in front of the repository
value among the settings of serverless.yml
.
In my case, I'm using Circle.ci to deploy and I checked for build errors due to a -
character, and I removed it and nothing happened.
It may be just my case, but if not, it would be nice to correct it.
See getsentry/raven-node#338 for more details
Without this we risk to miss errors and messages as they are never sent out.
Does the lib support a feature of filtering events? (don't wana assign a new instance of sentry)
Reference:
https://docs.sentry.io/platforms/node/guides/aws-lambda/configuration/filtering
`import * as Sentry from "@sentry/browser";
init({
beforeSend(event, hint) {
const error = hint.originalException;
if (
error &&
error.message &&
error.message.match(/database unavailable/i)
) {
event.fingerprint = ["database-unavailable"];
}
return event;
},
});`
Since the latest minor version change (from 2.3.0
to 2.4.0
) the serverless deployment process on the project I am working on is failing with the following error message:
Error: Sentry: No Git available - Error: Command failed: git describe --exact-match --tags HEAD
fatal: No names found, cannot describe anything.
It appears that the cause is running git describe
on a git repository that has no tags; the repo I'm working on has no tags.
And I can see from 612f76d#diff-1bcdce6971f2549017c3a649865c9921b7e765fb368eb43e78fbc373a779ba31 that this package is no longer suppressing errors.
Can you suggest how to proceed?
Started using vandium, sentry no longer injecting
executed :
sls function deploy -t -s dev
checked _tmp, code did not get modified
sample code :
'use strict';
const vandium = require('vandium');
const db = require('./db.js');
const factoryCommonData = require('./factory-common-data.js');
var _connection = {};
vandium.after(function () {
return _connection.end();
});
module.exports.handler = vandium(main);
/***************MAIN IMPLEMENTATION********************/
function main(event){
return db.GetConnection()
.then(function (connection) {
_connection = connection;
return factoryCommonData.Countries(_connection);
})
}
After following the setup instructions and deploying a function, all requests return the following error:
{
"errorMessage": "Cannot find module 'raven'",
"errorType": "Error",
"stackTrace": [
"Function.Module._load (module.js:276:25)",
"Module.require (module.js:353:17)",
"require (internal/module.js:12:17)",
"Object.<anonymous> (/var/task/properties/_serverless_handler.js:1550:19)",
"Module._compile (module.js:409:26)",
"Object.Module._extensions..js (module.js:416:10)",
"Module.load (module.js:343:32)",
"Function.Module._load (module.js:300:12)",
"Module.require (module.js:353:17)"
]
}
Following the instructions this is what I have:
serverless.yml
custom:
variables: ${file(config/serverless/${self:provider.stage}.yml)}
sentry:
dsn: "https://[email protected]/xxxxxxxx"
plugins:
- serverless-delete-loggroups
- serverless-plugin-typescript
- serverless-plugin-existing-s3
- serverless-sentry
# - serverless-sentry-lib
And this is how I am using the code to send the message to Sentry:
...
import * as Raven from 'raven';
Raven.config('https://[email protected]/xxxxxxxx').install();
Raven.captureException('test 7');
This is the error I am getting when run dev in local and in AWS:
sls invoke local --function functionName --stage dev --path tests/events/test.json --profile testprof
Error --------------------------------------------------
data-pipeline-qa Unable to validate the following destination configurations
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
After I set the variable SLS_DEBUG to "*" like this:
environment:
SLS_DEBUG: "*"
I am still getting the same error.
But if I change the serverless.yml to:
plugins:
- serverless-delete-loggroups
- serverless-plugin-typescript
- serverless-plugin-existing-s3
# - serverless-sentry
- serverless-sentry-lib
# - serverless-plugin-optimize
It runs ok. I can see the message in Sentry.
But if I try do deploy for test inside AWS I get the error:
Error --------------------------------------------------
data-pipeline-qa Unable to validate the following destination configurations
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
AND if I set the value for SLS_DEBUG as required in the error to
environment:
SLS_DEBUG: "*"
It runs ok locally - I mean I can see the message inside Sentry,
But if I try to deploy in AWS i get the previous error again:
Error --------------------------------------------------
data-pipeline-qa Unable to validate the following destination configurations
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
I am very happy with how simple this plugin made integrating Sentry with my backend however, after successfully integrating the plugin I realized that my project has a use case for scrubbing PII and there is no support for data scrubbing and trace sampling/filtering. (Please correct me if I'm wrong)
The Sentry SDK comes out the box with the two methods that are the beforeSend method and tracesSampler method to allow filtering of transactions and a way to delete specific data points from the event object before it is sent to Sentry.
Is this a feature that can be implemented?
Hi,
when we execute serverless deploy --package
, function setRelease is never called, then cause an error at the end of the deploy
Serverless: Sentry: Creating new release "true"...
Serverless: Sentry: Deploying release "true"...
Serverless: Sentry: Received error response from Sentry:
{"detail": "The requested resource does not exist"}
because release true
option in serverless.yml is never set.
It's a problem with --package option (skip packaging step) then don't call hooks after:package:init.
Thanks
Is this package still relevant compared to Sentry's official one?
https://docs.sentry.io/platforms/node/guides/aws-lambda/
Is there a mechanism to add custom tags to the scope of the sentry object?
Just testing out updating one of my projects to use the new v2.0.0 versions of your plugin and lib and have run into an error during deployment.
Looking into the code, it seems to be failing here in the compiled code:
return [4 /*yield*/, superagent_1.default
.post("https://sentry.io/api/0/organizations/" + organization + "/releases/")
.set("Authorization", "Bearer " + this.sentry.authToken)
.send(payload)];
When I change superagent_1.default
to just superagent_1
(remove .default
) from the code, the deployment works. I suspect its just an issue with the build process, but I'm not familiar with typescript so that's just a guess.
The full stacktrace is:
Error: Sentry: Error uploading release - TypeError: Cannot read property 'post' of undefined
at SentryPlugin.<anonymous> (/my-project/node_modules/serverless-sentry/dist/index.js:442:31)
at step (/my-project/node_modules/serverless-sentry/dist/index.js:44:23)
at Object.next (/my-project/node_modules/serverless-sentry/dist/index.js:25:53)
at /my-project/node_modules/serverless-sentry/dist/index.js:19:71
at new Promise (<anonymous>)
at __awaiter (/my-project/node_modules/serverless-sentry/dist/index.js:15:12)
at SentryPlugin.createSentryRelease (/my-project/node_modules/serverless-sentry/dist/index.js:408:16)
at SentryPlugin.<anonymous> (/my-project/node_modules/serverless-sentry/dist/index.js:100:59)
at step (/my-project/node_modules/serverless-sentry/dist/index.js:44:23)
at Object.next (/my-project/node_modules/serverless-sentry/dist/index.js:25:53)
at /my-project/node_modules/serverless-sentry/dist/index.js:19:71
at new Promise (<anonymous>)
at __awaiter (/my-project/node_modules/serverless-sentry/dist/index.js:15:12)
at Object.after:deploy:deploy [as hook] (/my-project/node_modules/serverless-sentry/dist/index.js:97:57)
at /my-project/node_modules/serverless/lib/classes/PluginManager.js:490:55
at tryCatcher (/my-project/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/my-project/node_modules/serverless/node_modules/bluebird/js/release/reduce.js:168:18)
at Object.gotAccum (/my-project/node_modules/serverless/node_modules/bluebird/js/release/reduce.js:155:25)
at Object.tryCatcher (/my-project/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/my-project/node_modules/serverless/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/my-project/node_modules/serverless/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/my-project/node_modules/serverless/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/my-project/node_modules/serverless/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/my-project/node_modules/serverless/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/my-project/node_modules/serverless/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/my-project/node_modules/serverless/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues (/my-project/node_modules/serverless/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:456:21)
at process.topLevelDomainCallback (domain.js:137:15)
Hi,
after upgrading to 0.2 , lambda execution never completes (gives an error "Task timed out after")
downgrading back to 0.1.4, lambda function works fine .
feels like something is not being returned or callback not bing called
Hello
I'm facing a problem using external .yml config files in my serverless.yml.
This works:
# serverless.yml
custom:
sentry:
dsn: https://xxxx:[email protected]/zzzz
organization: my-organziation
project: my-project
authToken: my-token
release: true
This doesn't work:
# serverless.yml
custom: ${file(staging.yml)}
# staging.yml
sentry:
dsn: https://xxxx:[email protected]/zzzz
organization: my-organziation
project: my-project
authToken: my-token
release: true
This doesn't work either:
# serverless.yml
custom:
env: ${file(staging.yml)}
sentry: ${self:custom.env.sentry}
# staging.yml
sentry:
dsn: https://xxxx:[email protected]/zzzz
organization: my-organziation
project: my-project
authToken: my-token
release: true
The only solution is:
# serverless.yml
custom:
env: ${file(staging.yml)}
sentry:
dsn: ${self:custom.env.sentry.dsn}
environment: ${self:custom.env.sentry.environment}
organization: ${self:custom.env.sentry.organization}
project: ${self:custom.env.sentry.project}
authToken: ${self:custom.env.sentry.authToken}
release: ${self:custom.env.sentry.release}
# staging.yml
sentry:
dsn: https://xxxx:[email protected]/zzzz
organization: my-organziation
project: my-project
authToken: my-token
release: true
serverless-sentry-plugin/src/index.js
Lines 54 to 59 in 1462dff
serverless-sentry-plugin/src/index.js
Lines 76 to 78 in 1462dff
Maybe we could use this._serverless.variables.populateObject()
directly on custom
instead of custom.sentry
(and only if sentry is an object) ?
Currently the plugin does not work when upgrading sentry/node to version 7.
Migration instructions below:
https://github.com/getsentry/sentry-javascript/blob/master/MIGRATION.md#upgrading-from-6x-to-7x
I have the following commits:
During serverless deployment, the release pushed to Sentry is v0.23.0-rc1
, which corresponds to the latest tag. But that's not the latest commit.
Serverless: Sentry: Creating new release "v0.23.0-rc1"...
Serverless: Sentry: Received error response from Sentry:
{"refs": ["Invalid repository names: my_company/my_repo"]}
I think we should push the latest git tag only when it's on HEAD
.
I am not using Cognito for Lambda authentication, but using custom authentication using Lambda NodeJS.
How I can set additional context such as:
Raven.setContext({
user: {
email: '[email protected]',
id: '123'
}
});
Thank your very much
When configuring release version as "random", the underlying serverless configuration is invalid.
In invalid cloudformation-template-update-stack.json
, we get something like:
"Environment": {
"Variables": {
"NODE_ENV": "production",
"SENTRY_DSN_CLIENT": "...",
"SENTRY_DSN": "..."
"SENTRY_RELEASE": {
"isFulfilled": true,
"isRejected": false,
"fulfillmentValue": "206cad0e9012458e88835839fd8aab33"
},
This fails on deployment because an environment variable cannot be (obviously) an object.
serverless-sentry-lib works for me in develop but not in production, my configuration of serverless.yml:
service: serverless-api
plugins:
- serverless-sentry
- serverless-webpack
- serverless-offline
provider:
name: aws
region: us-east-1
runtime: nodejs6.10
stage: production
environment: '${file(.env.yml):${self:custom.stage}}'
custom:
stage: '${opt:stage, self:provider.stage}'
serverless-offline:
port: 4000
babelOptions:
presets:
- es2015
- es2017
sentry:
dsn: https://(SECRET):(SECRET)@sentry.io/(SECRET)
filterLocal: true
.....
verify that the DSN is correct and that the issues are coming to me (local environment), but the mistakes that I am generating in production do not arrive
'use strict'
const response = require('../../helpers/response')
import User from '../../database/models/user'
var Raven = require('raven')
var RavenLambdaWrapper = require('serverless-sentry-lib')
module.exports.handler = RavenLambdaWrapper.handler(Raven, (event, context, callback) => {
context.callbackWaitsForEmptyEventLoop = false
global.cb = callback
const userid = event.pathParameters.userid
User.findOne({ where: { userid: userid }}).then((user) => {
if(user)
response('user logged', 200, user)
else
response('user logged', 200, {error: true})
}).catch(error => {
response('user logged', 200, {error: true, message: error})
})
})
Generate Error:
UsesdfsdfdsrfindOne({ where: { userid: userid }}).then((user) => { // UsesdfsdfdsrfindOne is undefined (Exception)
if(user)
response('user logged', 200, user)
else
response('user logged', 200, {error: true})
}).catch(error => {
response('user logged', 200, {error: true, message: error})
})
Packaje.json
"dependencies": {
....
....
"raven": "2.2.1",
"serverless-sentry-lib": "1.0.0-rc.2"
},
"devDependencies": {
"serverless-sentry": "1.0.0-rc.4",
}
Rationale
The lambda code generated by the plugin is dependent on raven and will not ever start, but immediately break out with an exception, if the dependent module is missing. If you use the optimizer plugin, it is very hard so see what you did wrong. This is something that easily can happen when setting up a new lambda that uses the plugin.
Dependencies introduced by plugins that make the code crash when missing, should be either installed by the plugin or any use of the generated function should be denied by it.
Proposal
On function deploy the plugin should break out if raven is not found as installed dependency.
You mention Other platforms can be added easily by providing a respective integration library
. I am interested in adding support for python but am a bit lost on where exactly you foresee this library supporting other languages. I think there are two core parts to supporting a new language:
But I am not sure how we would traverse the python/node boundary.
Any insight?
Is there any way to use this plugin with the latest version of the Sentry SDK? They have deprecated the Raven version.
Serverless Framework, over year ago was equipped with validation schema for all its service configuration. It allows to quickly pin point eventual errors developers are making when they're constructing service configurations.
It was provided with utilities for plugins so all properties that are introduced by them can also be easily accompanied with needed schema: https://www.serverless.com/framework/docs/providers/aws/guide/plugins#extending-validation-schema
Serverless Framework is about to release a v3, and with that version it's scheduled that by default any configuration errors (and undefined property is signaled as an error) will be reported with crashes and not warnings as it is in v2.
This will affect users which configure functions[].sentry
, (custom
namespace is excluded from that, as we allow free-form user configuration in that, still it's also good to provide schema for any properties in custom
that plugin introduces).
It'll be great if plugin is upgraded and defines schemas for properties it introduces
This is caused by a weird issue with gitlab api requiring spaces around repository names. See getsentry/sentry#12582
Add a check for this.serverless.service.provider.shouldNotDeploy
to determine if we need to deploy to sentry or not. If no code changes were reported by Serverless, there's no reason to create a deploy even in Sentry either.
Are there any plans to support the upload of javascript sourcemaps?
https://docs.sentry.io/clients/javascript/sourcemaps/
I user webpack & uglify on my project and this would help to show the original source code on exceptions
Is not possible at the moment as sentry.io does not support this for node :-(
getsentry/sentry#2632
I tried to upload thru the sentry cli and tested with webpack devtool: 'source-map'
and devtool: 'inline-source-map'
but nothing worked as this feature is deactivated for node project globally
What is wrong with my code that the configuration for "filterLocal" gets ignored?
Or how can I access the right instance of the wrapper in my App Object?
This is my excerpt from serverless.yml
:
sentry:
dsn: https://[email protected]/YYYYY
organization: ORG
project: PRJ
authToken: *****
release: true
filterLocal: true
starting server less offline
:
...
Serverless: GET /getYYYY/b/a (λ: getYYYY)
Serverless: The first request might take a few extra seconds
Sentry **disabled in local environment**
...
this is the code in the handler.js
:
import 'source-map-support/register';
import Raven from 'raven';
import RavenLambdaWrapper from 'serverless-sentry-lib';
import AppHandler from './app';
const handler = new AppHandler({});
export const getYYYY = RavenLambdaWrapper.handler(Raven, handler.getwlanuser() );
this is the code in the app.js:
import Raven from 'raven';
export default class {
getYYYY() {
return (event, context, cb) => {
Raven.captureMessage('Test Start');
}
}
}
This plugin appears to be incompatible with serverless-http.
Example:
module.exports.api = RavenLambdaWrapper.handler(Raven, serverless(app));
it works fine when running the code locally using serverless-offline
but when running on lambda I get Task timed out after 6.01 seconds
in the cloudwatch logs and a response that looks like.
{
"message": "Internal server error"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.