Skip to content

Commit

Permalink
Explain how to set baggage and sentry-trace meta tags on Remix. (#…
Browse files Browse the repository at this point in the history
…5377)

Requires Remix SDK 7.9.0
  • Loading branch information
onurtemizkan authored Aug 5, 2022
1 parent dd5bece commit 6b85758
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/includes/performance/connect-services/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,29 @@ For traces that begin in your backend, you can connect the automatically-generat
</html>
```

<PlatformSection supported={["javascript.remix"]} notSupported={["javascript"]}>

Remix SDK attaches `sentry-trace` and `baggage` values from your `root` loader. You need to use [`meta`](https://remix.run/docs/en/v1/api/conventions#meta) function to attach the data from your `loader` as `<meta>` tags. The following code snippet shows how to do this:

```typescript {filename: root.tsx}
export const meta: MetaFunction = ({data}) => {
return {
// ...
'sentry-trace': data.sentryTrace,
baggage: data.sentryBaggage,
};
};
```

<Alert level="warning" title="Support">

This feature is available on Sentry Remix SDK version 7.9.0 and above.

</Alert>

</PlatformSection>


The `name` attributes must be the strings `"sentry-trace"` and `"baggage"` and the `content` attributes must be generated by your backend Sentry SDK. For `sentry-trace`, use `span.toSentryTrace()` (or equivalent, depending on the backend platform). This guarantees that a new and unique value will be generated for each request. For `baggage`, use `serializeBaggage(span.getBaggage())`.
<Note>

Expand Down

0 comments on commit 6b85758

Please sign in to comment.