-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable before_send_transaction for python (#6089)
Document before_send_transaction for python (+ code snippet)
- Loading branch information
1 parent
4ff0700
commit a952b9f
Showing
3 changed files
with
18 additions
and
3 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/platform-includes/configuration/before-send-transaction/python.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
In Python a function can be used to modify the transaction event or return a completely new one. If you return `None`, the event will be discarded. | ||
|
||
```python | ||
import sentry_sdk | ||
|
||
def strip_sensitive_data(event, hint): | ||
# modify event here | ||
return event | ||
|
||
sentry_sdk.init( | ||
# ... | ||
|
||
before_send_transaction=strip_sensitive_data, | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a952b9f
There was a problem hiding this comment.
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 – ./
sentry-docs-git-master.sentry.dev
sentry-docs.sentry.dev
docs.sentry.io