How to Write - Enriching Events
The Enriching Events section of the content covers how customers can add context to the data sent to Sentry. In most cases, the SDK will adopt the common content, which is stored in /platforms/common/enriching-events/
- feel free to peruse the files in that directory to answer any questions.
DO NOT change the common content. That change will ripple across all SDKs that rely on the common content. Instead, open an issue on GitHub with questions/suggestions.
Most of these pages are pretty self-evident, so only basic information is provided. But please ask questions by opening an issue on GitHub.
Start Here
Determine if the page applies:
- If the content does not apply, add the SDK to
notSupported
list in the frontmatter of the file. This will turn off the display of the content for this SDK. - If the content does apply, add the
include
file to the correct directory as noted for each page. If the code sample is not provided, the page will display a big gray box requesting customers open an issue for the missing sample. - The JS family of content needs to import the SDK for the code samples to make sense on each page. Add the import statement to
/src/platform-includes/enriching-events/enriching-events/import
.
Add Context
This file is context.mdx
. It explains how to enable custom contexts. Add the code sample to this directory:
/src/platform-includes/enriching-events/set-context/
If the SDK can pass context directly, add it to the list of supported SDKs immediately above "Passing Context Directly".
Identify Users
This file is identify-user.mdx
. It explains how to capture the user. Add the code samples to these directories:
/src/platform-includes/enriching-events/set-user/
/src/platform-includes/enriching-events/unset-user/
Set Transaction Name
This file is transaction-name.mdx
. It explains how to override the transaction name. Add the code sample to this directory:
/src/platform-includes/enriching-events/set-transaction-name/
If the SDK can control the starting and stopping of transactions, add it to the list of supported SDKs that refers customers to our
Customize Tags
This file is tags.mdx
. It explains how to customize tags for an event. Add the code sample to this directory:
/src/platform-includes/enriching-events/set-tag/
If the SDK doesn't bind tags to the current scope, add it to the list of SDKs that don't support this option.
Attachments
This file is /attachments/index.mdx
. It explains attaching files along with the event. Add the code sample to this directory:
/src/platform-includes/enriching-events/add-attachment/
If the SDK is part of the native family, add it to the list of SDKs that support the native content regarding:
- Debug information files and built-in support for native crashes
- Large crash reports
- The section on "Crash Reports and Privacy"
- The paragraph regarding limiting crash reports per issue
Breadcrumbs
This file is breadcrumbs.mdx
. It explains manual breadcrumbs. Add the code sample to manually add record a breadcrumb to this directory:
/src/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/
/src/platform-includes/enriching-events/breadcrumbs/before-breadcrumb/
One nuance:
- Update, as appropriate, the supported SDK list in the
PlatformSection supported
that precedes "The available breadcrumb keys..."
User Feedback
This file is user-feedback.mdx
. It explains how to use the embeddable JS widget or the API.
- Update, as appropriate, the supported SDK list in the
PlatformSection supported
that precedes "User Feedback API". Then add the code sample to thesrc/platform-includes/user-feedback/sdk-api-example
directory - For the .NET family, if the User Feedback API has a specific integration, add it to the
PlatformSection supported
that precedes the "Use the .NET SDK", and add the appropriate link. - Update, as appropriate, the SDKs that don't support the JS widget in the listed
PlatformSection notSupported
that precedes "Embeddeable JavaScript Widget". - For the SDKs that use the JS widget, add the code sample to
/src/platform-includes/user-feedback/user-feedback-example-widget/
Scopes
This file is scopes.mdx
. It explains managing scopes. Add the code samples to these directories:
/src/platform-includes/enriching-events/scopes/configure-scope/
/src/platform-includes/enriching-events/unset-user/
/src/platform-includes/enriching-events/scopes/with-scope/
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").