Skip to main content

Sentry SDK SQS Transport

https://img.shields.io/pypi/v/sentry_sqs_transport.svg https://travis-ci.com/terrycain/sentry-sqs-transport.svg?branch=master Updates

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

Metadata

Release files for sentry-sqs-transport 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sentry-sqs-transport 1.0.1
File Size Uploaded
sentry-sqs-transport-1.0.1.tar.gz 9.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sentry-sqs-transport 1.0.1
File Interpreter ABI Platform
sentry_sqs_transport-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.0 kB

Release files / sentry-sqs-transport-1.0.1.tar.gz

Download URL sentry-sqs-transport-1.0.1.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bc95acb1a5b2a483d7474c1b51a53d015201fa1fa8a0c90988c917d2eef9639d
BLAKE2b-256 checksum
How to use checksums
56c8580cecd99946e7e2306530ae53c769d99f6011c658f3e2f378a468985ab1
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / sentry_sqs_transport-1.0.1-py3-none-any.whl

Download URL sentry_sqs_transport-1.0.1-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab9b710d2597ecbd71de91a6d148807a8f4eecfc9f82c8b2f98420d1fc9024d6
BLAKE2b-256 checksum
How to use checksums
d34696f9a6e49a204ce92b99636005d6093af8c707925d80b365bcfa687740be
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page