Skip to content

Commit

Permalink
Docs for new ARQ integration (#6363)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhenay authored Feb 28, 2023
1 parent 556e41c commit 25ceb77
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions src/platforms/python/guides/arq/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: ARQ
description: "Learn about using Sentry with ARQ."
---

The ARQ integration adds support for the [ARQ Job Queue System](https://arq-docs.helpmanual.io/).

## Install

Install `sentry-sdk` from PyPI with the `arq` extra.

```bash
pip install --upgrade "sentry-sdk[arq]"
```

## Configure

Job definition in `demo.py`:

```python
import sentry_sdk
from sentry_sdk.integrations.arq import ArqIntegration


sentry_sdk.init(
dsn="...",
integrations=[
ArqIntegration(),
],
traces_sample_rate=1.0,
)


async def add_numbers(ctx, a, b):
return a + b


class WorkerSettings:
functions = [add_numbers]
```

Running the jobs in `run.py`:

```python
import asyncio
import sentry_sdk
from sentry_sdk.integrations.arq import ArqIntegration
from sentry_sdk.tracing import TRANSACTION_SOURCE_COMPONENT


async def main():
sentry_sdk.init(
dsn="...",
integrations=[
ArqIntegration(),
],
traces_sample_rate=1.0,
)

redis = await create_pool(RedisSettings())

with sentry_sdk.start_transaction(name="testing_arq_jobs", source=TRANSACTION_SOURCE_COMPONENT):
r = await redis.enqueue_job("download_content", 1, 2)


if __name__ == "__main__":
asyncio.run(main())
```

## Supported Versions

- ARQ: 0.23+
- Python: 3.7+

1 comment on commit 25ceb77

@vercel
Copy link

@vercel vercel bot commented on 25ceb77 Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sentry-docs – ./

docs.sentry.io
sentry-docs-git-master.sentry.dev
sentry-docs.sentry.dev

Please sign in to comment.