Drop-in replacement for Sentry's default HTTP transport to send events via AWS Lambda proxy instead
npm install @mailbutler/sentry-lambda-proxy-transport> Drop-in replacement transport for Sentry to transmit events via Lambda HTTP proxy
[![NPM Version][npm-image]][npm-url]
[![Downloads Stats][npm-downloads]][npm-url]
If you run into the problem of not being able to perform HTTP requests to external resources from a resource within a VPC, e.g. a Lambda function, then performing the HTTP request through a simple Lambda HTTP proxy function could be a solution.
This module builds on top of lambda-http-proxy and allows to use Sentry error logging from inside a AWS VPC without requiring complex networking setup.
``sh`
npm install sentry-lambda-proxy-transport --save
Please follow the instructions for lambda-http-proxy to configure your AWS environment correctly.
After having prepared your AWS environment, you can now import the module into your project, e.g. a Lambda function and initialize your Sentry instance to send events via the Lambda proxy function:
`js
import { LambdaProxyTransport } from "@mailbutler/sentry-lambda-proxy-transport";
Sentry.init({
// regular configuration of your Sentry instance, including 'dsn'
// use Lambda proxy transport instead of default HTTP transport
transport: LambdaProxyTransport,
});
`
- 1.0
- Initial version
1. Fork it (
2. Create your feature branch (git checkout -b feature/fooBar)git commit -am 'Add some fooBar'
3. Commit your changes ()git push origin feature/fooBar`)
4. Push to the branch (
5. Create a new Pull Request
[npm-image]: https://img.shields.io/npm/v/@mailbutler/sentry-lambda-proxy-transport.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@mailbutler/sentry-lambda-proxy-transport
[npm-downloads]: https://img.shields.io/npm/dm/@mailbutler/sentry-lambda-proxy-transport.svg?style=flat-square