Netflix-Skunkworks/raven-sqs-proxy

Name: raven-sqs-proxy

Owner: Netflix-Skunkworks

Description: A Raven/Sentry SQS message proxy forwarder

Created: 2017-09-27 22:56:46.0

Updated: 2018-04-28 06:56:11.0

Pushed: 2017-09-29 17:36:06.0

Homepage: null

Size: 10

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Sentry/Raven SQS Proxy

Build Status PyPI version

About

This is a very simple Python project that polls SQS for Sentry messages and then proxies them over to a Sentry instance.

This is based on the implementation of the Sentry.IO SQSTransport as implemented in this PR to raven-python.

How to use:

The first part in using this is to make use of the Sentry SQSTransport implemented in the getsentry/raven-python project.

This will have an instance, lambda function, or anything with AWS credentials to an SQS queue to forward all Sentry messages to SQS. This project will then listen for those messages on the queue and simply proxy them over to Sentry for storage.

Required Items:

For sending to the SQS queue, you will need the following:

  1. An SQS queue
  2. An IAM role with the following permissions to the SQS queue in question:
    GetQueueUrl
    SendMessage
    
  3. A Sentry DSN
  4. Python code that creates a Sentry client that looks similar to this:
     raven.base import Client
     raven.transport.sqs import SQSTransport
    
    S details that are required are:
     `sqs_region`
     `sqs_account` This is the 12 digit AWS account number
     `sqs_name` 
    
    ry_client = Client(dsn="https://some-sentry-dsn?sqs_region=REGION&sqs_account=ACCOUNT_NUMsqs_name=QUEUE_NAME",
                       transport=SQSTransport)
    

For retrieving messages:

  1. Access to the SQS queue the source app above is sending to. This will need the following permissions against the queue:
    GetQueueUrl
    SendMessage
    DeleteMessage
    
  2. Network-level access to the Sentry instance
Installation:
  1. Make and activate a Python virtual environment
  2. Run pip install raven_sqs_proxy to install this
  3. Hopefully you are running with on-instance AWS IAM role credentials. Otherwise, you will need to export them into your environment.
  4. Run sqsproxy --queue-name NAME-OF-QUEUE --queue-region QUEUE-REGION --queue-account AWS_ACCOUNT_ID_OF_QUEUE

That's it.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.