Signup/sentry. IO /signup/
Open the registration address, enter the home page to register:
After successful registration, the transfer language selection screen will be displayed. Here I select Python:
Install sentry-SDK with PIP:
pip install --upgrade sentry-sdk
Copy the code
Import and initialize the Sentry SDK early in the application setup:
import sentry_sdk
sentry_sdk.init(
"https://[email protected]/5831472"#,Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
traces_sample_rate=1.0
)
Copy the code
The above configuration captures both error and performance data. To reduce the amount of performance data captured, change traces_SAMple_rate to a value between 0 and 1.
One way to verify your Settings is to deliberately cause errors that break your application.
Raise an unhandled Python exception by inserting a divide by zero expression in the application:
division_by_zero = 1 / 0
Copy the code
After running the program, the Sentry-SDK receives an exception alarm: