Skip to main content
.. raw:: html

<p align="center">

.. image:: https://sentry-brand.storage.googleapis.com/sentry-logo-black.png
:target: https://sentry.io
:align: center
:width: 116
:alt: Sentry website

.. raw:: html

</p>

===========================================================
Raven-Aiohttp - Asyncio Transport for the Sentry Python SDK
===========================================================

.. image:: https://img.shields.io/pypi/v/raven-aiohttp.svg
:target: https://pypi.python.org/pypi/raven-aiohttp
:alt: PyPi page link -- version

.. image:: https://travis-ci.org/getsentry/raven-aiohttp.svg?branch=master
:target: https://travis-ci.org/getsentry/raven-aiohttp

.. image:: https://img.shields.io/pypi/l/raven-aiohttp.svg
:target: https://pypi.python.org/pypi/raven-aiohttp
:alt: PyPi page link -- BSD licence

.. image:: https://img.shields.io/pypi/pyversions/raven-aiohttp.svg
:target: https://pypi.python.org/pypi/raven-aiohttp
:alt: PyPi page link -- Python versions


A transport for the `Sentry Python SDK`_ which supports Python 3's asyncio interface.
For more information about Sentry and the python SDK, see our `Python Documentation`_ for framework integrations
and other goodies.

Requirements
============

- `raven-python>=5.4.0`
- `python>=3.4.2`
- `aiohttp>=2.0`

Usage
=====

`raven-aiohttp` ships two asyncio based transports for `raven.Client`: `AioHttpTransport` and `QueuedAioHttpTransport`.

AioHttpTransport
----------------

All messages to the sentry server will be produced by "Fire And Forget"

Each new message spawns it owns `asyncio.Task`, amount of them is not limited

.. code-block:: python

import asyncio

from raven import Client
from raven_aiohttp import AioHttpTransport

client = Client(transport=AioHttpTransport)

try:
1 / 0
except ZeroDivisionError:
client.captureException()

# graceful shutdown waits until all pending messages are send

loop = asyncio.get_event_loop()
loop.run_until_complete(client.remote.get_transport().close())


QueuedAioHttpTransport
----------------------

All messages to the sentry server will be produced by queue system

When transport is created it spawns limited amount of `asyncio.Task`
which sends messages one by one from internal `asyncio.Queue`

.. code-block:: python

import asyncio
from functools import partial

from raven import Client
from raven_aiohttp import QueuedAioHttpTransport

client = Client(transport=partial(QueuedAioHttpTransport, workers=5, qsize=1000))

try:
1 / 0
except ZeroDivisionError:
client.captureException()

# graceful shutdown waits until internal queue is empty

loop = asyncio.get_event_loop()
loop.run_until_complete(client.remote.get_transport().close())



Resources
=========

* `Sentry`_
* `Python Documentation`_
* `Issue Tracker`_
* `IRC Channel`_ (irc.freenode.net, #sentry)

.. _Sentry: https://getsentry.com/
.. _Sentry Python SDK: https://github.com/getsentry/raven-python
.. _Python Documentation: https://docs.getsentry.com/hosted/clients/python/
.. _Issue Tracker: https://github.com/getsentry/raven-aiohttp/issues
.. _IRC Channel: irc://irc.freenode.net/sentry




Metadata

Release files for raven-aiohttp 0.7.0

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

Source distribution (sdist)

Source distribution for raven-aiohttp 0.7.0
File Size Uploaded
raven-aiohttp-0.7.0.zip 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for raven-aiohttp 0.7.0
File Interpreter ABI Platform
raven_aiohttp-0.7.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 16.4 kB

Release files / raven-aiohttp-0.7.0.zip

Download URL raven-aiohttp-0.7.0.zip
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1444a49c93a85b8bb57c6ee649e512368dce7a26ad64ac3a01d86aa5669d77f3
BLAKE2b-256 checksum
How to use checksums
39120693844b4d7650dbaea5edf5cef0dba94a7887fe0d72f4a1b34de173a465
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / raven_aiohttp-0.7.0-py2.py3-none-any.whl

Download URL raven_aiohttp-0.7.0-py2.py3-none-any.whl
Size 6.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6a34b6a9841ad0fd827eeb158edb5826c5c5bd7babe2cde2a3f23eb85313af04
BLAKE2b-256 checksum
How to use checksums
75a4985f48344dd40329a6a07376c59f473cd78e26783d1b9bf2bb87756c36bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.0

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.1

2 release files

0.1.0

1 release file

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