From 38e628c39fb30a761f75cc3b4a2507cebaacac41 Mon Sep 17 00:00:00 2001 From: Hubert Sosinski Date: Mon, 19 Jan 2026 11:32:10 +0100 Subject: [PATCH 1/4] Add request-id to API's related spans --- ...+browser+10.24.0+001+request-id-support.patch | 15 +++++++++++++++ patches/sentry-browser/details.md | 8 ++++++++ ...try+core+10.24.0+002+request-id-support.patch | 16 ++++++++++++++++ patches/sentry-core/details.md | 7 +++++++ 4 files changed, 46 insertions(+) create mode 100644 patches/sentry-browser/@sentry+browser+10.24.0+001+request-id-support.patch create mode 100644 patches/sentry-browser/details.md create mode 100644 patches/sentry-core/@sentry+core+10.24.0+002+request-id-support.patch diff --git a/patches/sentry-browser/@sentry+browser+10.24.0+001+request-id-support.patch b/patches/sentry-browser/@sentry+browser+10.24.0+001+request-id-support.patch new file mode 100644 index 0000000000000..85725e4e067b0 --- /dev/null +++ b/patches/sentry-browser/@sentry+browser+10.24.0+001+request-id-support.patch @@ -0,0 +1,15 @@ +diff --git a/node_modules/@sentry/browser/build/npm/esm/tracing/request.js b/node_modules/@sentry/browser/build/npm/esm/tracing/request.js +index da5822e..04f3c80 100644 +--- a/node_modules/@sentry/browser/build/npm/esm/tracing/request.js ++++ b/node_modules/@sentry/browser/build/npm/esm/tracing/request.js +@@ -225,6 +225,10 @@ function xhrCallback( + const span = spans[spanId]; + if (span && sentryXhrData.status_code !== undefined) { + setHttpStatus(span, sentryXhrData.status_code); ++ const requestId = handlerData.xhr.getResponseHeader('x-request-id'); ++ if (requestId) { ++ span.setAttribute('request-id', requestId) ++ } + span.end(); + + onRequestSpanEnd?.(span, { diff --git a/patches/sentry-browser/details.md b/patches/sentry-browser/details.md new file mode 100644 index 0000000000000..9a3e59af12035 --- /dev/null +++ b/patches/sentry-browser/details.md @@ -0,0 +1,8 @@ +# `@sentry/browser` patches + +### [@sentry+browser+10.24.0+request-id-support.patch](@sentry+browser+10.24.0+request-id-support.patch) + +Reason: improve developer experience by adding `request-id` to spans related to API calls. This takes request-id from response headers and write it to the span related to that response. With that information it is easier to connect backend request / logs with data retrieved from Sentry. +- Upstream PR/issue: N/A +- E/App issue: https://github.com/Expensify/App/pull/74193 +- PR Introducing Patch: \ No newline at end of file diff --git a/patches/sentry-core/@sentry+core+10.24.0+002+request-id-support.patch b/patches/sentry-core/@sentry+core+10.24.0+002+request-id-support.patch new file mode 100644 index 0000000000000..4792ef44bb96a --- /dev/null +++ b/patches/sentry-core/@sentry+core+10.24.0+002+request-id-support.patch @@ -0,0 +1,16 @@ +diff --git a/node_modules/@sentry/core/build/esm/fetch.js b/node_modules/@sentry/core/build/esm/fetch.js +index 3c6eafb..33481e8 100644 +--- a/node_modules/@sentry/core/build/esm/fetch.js ++++ b/node_modules/@sentry/core/build/esm/fetch.js +@@ -235,7 +235,10 @@ function _addTracingHeadersToFetchRequest( + function endSpan(span, handlerData) { + if (handlerData.response) { + setHttpStatus(span, handlerData.response.status); +- ++ const requestId = handlerData.response?.headers?.get('x-request-id'); ++ if (requestId) { ++ span.setAttribute('request-id', requestId) ++ } + const contentLength = handlerData.response?.headers?.get('content-length'); + + if (contentLength) { diff --git a/patches/sentry-core/details.md b/patches/sentry-core/details.md index 42a14f37c1d5e..d54917ca72cba 100644 --- a/patches/sentry-core/details.md +++ b/patches/sentry-core/details.md @@ -11,3 +11,10 @@ - Upstream PR/issue: https://github.com/getsentry/sentry-javascript/pull/18398 - E/App issue: https://github.com/Expensify/App/issues/76128 - PR Introducing Patch: https://github.com/Expensify/App/pull/76547 + +### [@sentry+core+10.24.0+request-id-support.patch](@sentry+core+10.24.0+request-id-support.patch) + +Reason: improve developer experience by adding `request-id` to spans related to API calls. This takes request-id from response headers and write it to the span related to that response. With that information it is easier to connect backend request / logs with data retrieved from Sentry. +- Upstream PR/issue: N/A +- E/App issue: https://github.com/Expensify/App/pull/74193 +- PR Introducing Patch: \ No newline at end of file From 6d4b20c1250f32bf34a5604d79e865251d769f94 Mon Sep 17 00:00:00 2001 From: Hubert Sosinski Date: Mon, 19 Jan 2026 11:32:43 +0100 Subject: [PATCH 2/4] Add request-id to API's related spans --- patches/sentry-browser/details.md | 2 +- patches/sentry-core/details.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/sentry-browser/details.md b/patches/sentry-browser/details.md index 9a3e59af12035..c4b3776c1f157 100644 --- a/patches/sentry-browser/details.md +++ b/patches/sentry-browser/details.md @@ -5,4 +5,4 @@ Reason: improve developer experience by adding `request-id` to spans related to API calls. This takes request-id from response headers and write it to the span related to that response. With that information it is easier to connect backend request / logs with data retrieved from Sentry. - Upstream PR/issue: N/A - E/App issue: https://github.com/Expensify/App/pull/74193 -- PR Introducing Patch: \ No newline at end of file +- PR Introducing Patch: https://github.com/Expensify/App/pull/79883 \ No newline at end of file diff --git a/patches/sentry-core/details.md b/patches/sentry-core/details.md index d54917ca72cba..f8d2c23dfdc24 100644 --- a/patches/sentry-core/details.md +++ b/patches/sentry-core/details.md @@ -17,4 +17,4 @@ Reason: improve developer experience by adding `request-id` to spans related to API calls. This takes request-id from response headers and write it to the span related to that response. With that information it is easier to connect backend request / logs with data retrieved from Sentry. - Upstream PR/issue: N/A - E/App issue: https://github.com/Expensify/App/pull/74193 -- PR Introducing Patch: \ No newline at end of file +- PR Introducing Patch: https://github.com/Expensify/App/pull/79883 \ No newline at end of file From dd1a888cd093f7d64bbab57b04c35f9182ea269b Mon Sep 17 00:00:00 2001 From: Hubert Sosinski Date: Mon, 19 Jan 2026 11:34:09 +0100 Subject: [PATCH 3/4] Add request-id to API's related spans --- patches/sentry-browser/details.md | 2 +- patches/sentry-core/details.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/sentry-browser/details.md b/patches/sentry-browser/details.md index c4b3776c1f157..57c67d8ed553b 100644 --- a/patches/sentry-browser/details.md +++ b/patches/sentry-browser/details.md @@ -4,5 +4,5 @@ Reason: improve developer experience by adding `request-id` to spans related to API calls. This takes request-id from response headers and write it to the span related to that response. With that information it is easier to connect backend request / logs with data retrieved from Sentry. - Upstream PR/issue: N/A -- E/App issue: https://github.com/Expensify/App/pull/74193 +- E/App issue: https://github.com/Expensify/App/issues/75588 - PR Introducing Patch: https://github.com/Expensify/App/pull/79883 \ No newline at end of file diff --git a/patches/sentry-core/details.md b/patches/sentry-core/details.md index f8d2c23dfdc24..2a0d7a2d0707e 100644 --- a/patches/sentry-core/details.md +++ b/patches/sentry-core/details.md @@ -16,5 +16,5 @@ Reason: improve developer experience by adding `request-id` to spans related to API calls. This takes request-id from response headers and write it to the span related to that response. With that information it is easier to connect backend request / logs with data retrieved from Sentry. - Upstream PR/issue: N/A -- E/App issue: https://github.com/Expensify/App/pull/74193 +- E/App issue: https://github.com/Expensify/App/issues/75588 - PR Introducing Patch: https://github.com/Expensify/App/pull/79883 \ No newline at end of file From 1ef2ee9aab52814bde9d78e5f464680d2ae3d868 Mon Sep 17 00:00:00 2001 From: Hubert Sosinski Date: Mon, 19 Jan 2026 11:45:14 +0100 Subject: [PATCH 4/4] Add request-id to API's related spans --- patches/sentry-browser/details.md | 2 +- patches/sentry-core/details.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/sentry-browser/details.md b/patches/sentry-browser/details.md index 57c67d8ed553b..947ee51897804 100644 --- a/patches/sentry-browser/details.md +++ b/patches/sentry-browser/details.md @@ -1,6 +1,6 @@ # `@sentry/browser` patches -### [@sentry+browser+10.24.0+request-id-support.patch](@sentry+browser+10.24.0+request-id-support.patch) +### [@sentry+browser+10.24.0+001+request-id-support.patch](@sentry+browser+10.24.0+001+request-id-support.patch) Reason: improve developer experience by adding `request-id` to spans related to API calls. This takes request-id from response headers and write it to the span related to that response. With that information it is easier to connect backend request / logs with data retrieved from Sentry. - Upstream PR/issue: N/A diff --git a/patches/sentry-core/details.md b/patches/sentry-core/details.md index 2a0d7a2d0707e..c347d312581d2 100644 --- a/patches/sentry-core/details.md +++ b/patches/sentry-core/details.md @@ -12,7 +12,7 @@ - E/App issue: https://github.com/Expensify/App/issues/76128 - PR Introducing Patch: https://github.com/Expensify/App/pull/76547 -### [@sentry+core+10.24.0+request-id-support.patch](@sentry+core+10.24.0+request-id-support.patch) +### [@sentry+core+10.24.0+002+request-id-support.patch](@sentry+core+10.24.0+002+request-id-support.patch) Reason: improve developer experience by adding `request-id` to spans related to API calls. This takes request-id from response headers and write it to the span related to that response. With that information it is easier to connect backend request / logs with data retrieved from Sentry. - Upstream PR/issue: N/A