From 9f83b49be7091d5aae6e47af474bed66b9537ec5 Mon Sep 17 00:00:00 2001 From: Onur Temizkan Date: Wed, 3 Aug 2022 12:33:43 +0000 Subject: [PATCH 1/2] Explain how to set `baggage` and `sentry-trace` meta tags on Remix. --- .../performance/connect-services/javascript.mdx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/includes/performance/connect-services/javascript.mdx b/src/includes/performance/connect-services/javascript.mdx index 7b4865341ad64..ba04a3c1b3172 100644 --- a/src/includes/performance/connect-services/javascript.mdx +++ b/src/includes/performance/connect-services/javascript.mdx @@ -30,6 +30,23 @@ For traces that begin in your backend, you can connect the automatically-generat ``` + + +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 `` 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, + }; +}; +``` + + + + 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())`. From c51fa656a328a1e7ab3eba088f3b881e558b3dab Mon Sep 17 00:00:00 2001 From: Onur Temizkan Date: Fri, 5 Aug 2022 13:01:51 +0000 Subject: [PATCH 2/2] Add version warning (exact version to be updated). --- src/includes/performance/connect-services/javascript.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/includes/performance/connect-services/javascript.mdx b/src/includes/performance/connect-services/javascript.mdx index ba04a3c1b3172..b66c1730cfb8d 100644 --- a/src/includes/performance/connect-services/javascript.mdx +++ b/src/includes/performance/connect-services/javascript.mdx @@ -44,6 +44,12 @@ export const meta: MetaFunction = ({data}) => { }; ``` + + +This feature is available on Sentry Remix SDK version 7.9.0 and above. + + +