You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To configure the SDK, initialize it with the integration before your app has been initialized:
23
+
If you have the `bottle` package in your dependencies, the Bottle integration will be enabled automatically when you initialize the Sentry SDK.
24
24
25
25
<SignInNote />
26
26
27
27
```python
28
+
from bottle import Bottle
28
29
import sentry_sdk
29
30
30
-
from bottle import Bottle, run
31
-
from sentry_sdk.integrations.bottle import BottleIntegration
32
-
33
31
sentry_sdk.init(
34
32
dsn="___PUBLIC_DSN___",
35
-
integrations=[
36
-
BottleIntegration(),
37
-
],
38
-
39
33
# Set traces_sample_rate to 1.0 to capture 100%
40
34
# of transactions for performance monitoring.
41
-
# We recommend adjusting this value in production,
42
35
traces_sample_rate=1.0,
43
36
)
44
37
45
38
app = Bottle()
46
39
```
47
40
41
+
## Verify
42
+
43
+
```python
44
+
from bottle import Bottle, run
45
+
46
+
sentry_sdk.init(...) # same as above
47
+
48
+
app = Bottle()
49
+
50
+
@app.route('/')
51
+
defhello():
52
+
1/0
53
+
return"Hello World!"
54
+
55
+
run(app, host='localhost', port=8000)
56
+
```
57
+
58
+
When you point your browser to [http://localhost:8000/](http://localhost:8000/) 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
+
48
62
## Behavior
49
63
50
64
- The Sentry Python SDK will install the Bottle integration for all of your apps. The integration hooks into base Bottle class.
@@ -57,6 +71,26 @@ app = Bottle()
57
71
58
72
## Options
59
73
74
+
If you add `BottleIntegration` explicitly to your `sentry_sdk.init()` call you can set options for `BottleIntegration` to change its behavior:
75
+
76
+
```python
77
+
import sentry_sdk
78
+
from sentry_sdk.integrations.bottle import BottleIntegration
79
+
80
+
sentry_sdk.init(
81
+
dsn="___PUBLIC_DSN___",
82
+
# Set traces_sample_rate to 1.0 to capture 100%
83
+
# of transactions for performance monitoring.
84
+
traces_sample_rate=1.0,
85
+
integrations= [
86
+
BottleIntegration(
87
+
transaction_style="endpoint",
88
+
),
89
+
],
90
+
)
91
+
92
+
```
93
+
60
94
You can pass the following keyword arguments to `BottleIntegration()`:
61
95
62
96
-`transaction_style`:
@@ -73,3 +107,8 @@ You can pass the following keyword arguments to `BottleIntegration()`:
73
107
-`myendpoint` if you set `transaction_style="endpoint"`
0 commit comments