How to Write - Enriching Events

The Enriching Events section of the content covers how customers can add context to the data sent to Sentry. A new framework can adopt the common content, which is stored in /docs/platforms/<SDK>/common/enriching-events - feel free to peruse the files in that directory to answer any questions.

Most of these pages are pretty self-evident, so only basic information is provided. But please ask questions by opening an issue on GitHub.

Determine if the page applies:

  • If the content does not apply, add the guide to notSupported list in the frontmatter of the file. This will turn off the display of the content for this guide.
  • 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.

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 guide can pass context directly, add it to the list of supported guides immediately above "Passing Context Directly".

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/

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 guide can control the starting and stopping of transactions, add it to the list of supported guides that refers customers to our tracing docs.

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 guide doesn't bind tags to the current scope, add it to the list of guides that don't support this option.

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 guide is part of the native family, add it to the list of guides 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

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 guide list in the PlatformSection supported that precedes "The available breadcrumb keys..."

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 the src/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/

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/
Help improve this content
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").