Skip to content

Commit 4c1b017

Browse files
antonpirkergetsantry[bot]shanamatthews
authored
Python: Getting Started quart (#7826)
* Python: Getting Started quart * style(lint): Auto commit lint changes * Update index.mdx * Update src/platforms/python/guides/quart/index.mdx Co-authored-by: Shana Matthews <shana.l.matthews@gmail.com> --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com> Co-authored-by: Shana Matthews <shana.l.matthews@gmail.com>
1 parent fff000f commit 4c1b017

File tree

1 file changed

+34
-13
lines changed

1 file changed

+34
-13
lines changed

src/platforms/python/guides/quart/index.mdx

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@ title: Quart
33
description: "Learn about using Sentry with Quart."
44
---
55

6-
The Quart integration adds support for the [Quart Web Framework](https://gitlab.com/pgjones/quart). We support Quart versions 0.16.1 and higher.
7-
8-
Requires `sentry-sdk` version `1.5.2` or higher.
9-
10-
A Python version of 3.7 or higher is also required.
6+
The Quart integration adds support for the [Quart Web Framework](https://gitlab.com/pgjones/quart).
117

128
## Install
139

14-
Install `sentry-sdk` from PyPI:
10+
Install `sentry-sdk` from PyPI with the `quart` extra:
1511

1612
```bash
17-
pip install --upgrade sentry-sdk
13+
pip install --upgrade sentry-sdk[quart]
1814
```
1915

2016
## Configure
@@ -24,25 +20,45 @@ To configure the SDK, initialize it with the integration before or after your ap
2420
<SignInNote />
2521

2622
```python
23+
from quart import Quart
24+
2725
import sentry_sdk
2826
from sentry_sdk.integrations.quart import QuartIntegration
29-
from quart import Quart
3027

3128
sentry_sdk.init(
3229
dsn="___PUBLIC_DSN___",
33-
integrations=[
34-
QuartIntegration(),
35-
],
36-
3730
# Set traces_sample_rate to 1.0 to capture 100%
3831
# of transactions for performance monitoring.
39-
# We recommend adjusting this value in production,
4032
traces_sample_rate=1.0,
33+
integrations=[
34+
QuartIntegration(),
35+
],
4136
)
4237

4338
app = Quart(__name__)
4439
```
4540

41+
# Verify
42+
43+
```python
44+
from quart import Quart
45+
46+
sentry_sdk.init(...) # same as above
47+
48+
app = Quart(__name__)
49+
50+
@app.route("/")
51+
async def hello():
52+
1/0 # raises an error
53+
return {"hello": "world"}
54+
55+
app.run()
56+
```
57+
58+
When you point your browser to [http://localhost:5000/](http://localhost:5000/) a transaction in the Performance section of [sentry.io](https://sentry.io) will be created. Additionally, an error event will be sent to [sentry.io](https://sentry.io) and will be connected to the transaction.
59+
60+
It takes a couple of moments for the data to appear in [sentry.io](https://sentry.io).
61+
4662
## Behavior
4763

4864
- The Sentry Python SDK will install the Quart integration for all of your apps.
@@ -54,3 +70,8 @@ app = Quart(__name__)
5470
- Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled.
5571

5672
- Logging with any logger will create breadcrumbs when the [Logging](/platforms/python/guides/logging/) integration is enabled (done by default).
73+
74+
## Supported Versions
75+
76+
- Quart: 0.16.1+
77+
- Python: 3.7+

0 commit comments

Comments
 (0)