An asyncio transport for raven-python
Project description
.. 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
<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
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
raven-aiohttp-0.7.0.zip
(10.1 kB
view details)
Built Distribution
File details
Details for the file raven-aiohttp-0.7.0.zip
.
File metadata
- Download URL: raven-aiohttp-0.7.0.zip
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1444a49c93a85b8bb57c6ee649e512368dce7a26ad64ac3a01d86aa5669d77f3 |
|
MD5 | 90139d110789c61dc7afc389dc2a939e |
|
BLAKE2b-256 | 39120693844b4d7650dbaea5edf5cef0dba94a7887fe0d72f4a1b34de173a465 |
File details
Details for the file raven_aiohttp-0.7.0-py2.py3-none-any.whl
.
File metadata
- Download URL: raven_aiohttp-0.7.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a34b6a9841ad0fd827eeb158edb5826c5c5bd7babe2cde2a3f23eb85313af04 |
|
MD5 | 01aaac3b6cf22e26f7dd59f2c8fecde6 |
|
BLAKE2b-256 | 75a4985f48344dd40329a6a07376c59f473cd78e26783d1b9bf2bb87756c36bf |