SQS Transport for the sentry-sdk
Project description
Simple AWS SQS sentry-sdk transport that takes ideas from https://github.com/Netflix-Skunkworks/raven-sqs-proxy
It closely follows the HTTPTransport just substituting the HTTP POST section with an SQS Send Message.
Installation
To install:
pip install sentry-sqs-transport
Below is an example of how to use the transport (note the transport keyword argument).
import sentry_sdk
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
from sentry_sqs_transport import SQSTransport
sentry_sdk.init(
dsn="https://00000000000000000000000000000000@sentry.example.org/11",
integrations=[AwsLambdaIntegration()],
transport=SQSTransport,
# Optional
sqs_queue_url='https://sqs.eu-west-2.amazonaws.com/000000000000/SomeQueue',
sqs_client_kwargs={'region_name': 'us-east-1'}
)
Configuration
To configure which SQS queue to use, pass sqs_queue_url into the SDK init function with the SQS queue url as the value. You can also set SENTRY_SQS_QUEUE_URL envrionment variable.
The parameter sqs_client_kwargs should be a dictionary and will be passed into the boto3 client like boto3.client('sqs', **sqs_client_kwargs).
SQS Message Format
The format of the message that is put on an SQS queue is a JSON payload which looks like the example below. The body is a base64’d form of what the SDK would usually post, which is also gzipped.
{
"method": "POST",
"headers": {
"User-Agent": "string",
"X-Sentry-Auth": "string",
"Content-Type": "application/json",
"Content-Encoding": "gzip",
},
"url": "https://sentry.example/org",
"body": "base64 string"
}
Sentry SQS Consumer
In the resources folder there is a simple lambda function that will consume these sentry events off the SQS queue and send them to sentry.
TODO
Add tests
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sentry-sqs-transport-1.0.1.tar.gz
.
File metadata
- Download URL: sentry-sqs-transport-1.0.1.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc95acb1a5b2a483d7474c1b51a53d015201fa1fa8a0c90988c917d2eef9639d |
|
MD5 | 30de5e333dc4c912594ad2184ac3f93e |
|
BLAKE2b-256 | 56c8580cecd99946e7e2306530ae53c769d99f6011c658f3e2f378a468985ab1 |
File details
Details for the file sentry_sqs_transport-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: sentry_sqs_transport-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab9b710d2597ecbd71de91a6d148807a8f4eecfc9f82c8b2f98420d1fc9024d6 |
|
MD5 | 6d7152e988d13754d4523c7a449821c7 |
|
BLAKE2b-256 | d34696f9a6e49a204ce92b99636005d6093af8c707925d80b365bcfa687740be |