From fa6d2ce5bfb204058dfed074b6a6858a98ef6b1f Mon Sep 17 00:00:00 2001 From: Francisco Gongora Date: Mon, 16 Nov 2026 17:30:14 -0500 Subject: [PATCH 1/2] feat(layout): render sid and environment on window.dtinfo for RUM (FRONTIER-5760) Co-Authored-By: Claude Opus 5.5 --- packages/react-scripts/layout/views/layout.ejs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/react-scripts/layout/views/layout.ejs b/packages/react-scripts/layout/views/layout.ejs index ba4c9ef91f5..9fca8f92fdc 100644 --- a/packages/react-scripts/layout/views/layout.ejs +++ b/packages/react-scripts/layout/views/layout.ejs @@ -68,8 +68,25 @@ // unconditionally and as early as possible. Both RUM Classic and the New RUM Experience can // read it via their own (separately configured) capture rules; gating it on the agent being // loaded meant the async treatments never set it at all. + // Keys: appName, sid (`//`) and environment (dev|test|prod), the + // primary Grail tag values, derived exactly as @fs/startup derives them for the dyno's + // processes so RUM events and back-end records match. Each frontend needs its own capture + // rule per key to copy it onto events. sid and environment come from the FS_* config vars + // only (never TARGET_ENV); a sid is positional, so it stops at the first missing or malformed + // segment; an unmapped system leaves environment unset rather than mislabelled. if (!window.dtinfo) window.dtinfo = {} window.dtinfo.appName = SERVER_DATA.appName + <% + const dtinfoSidSegments = [] + for (const segment of [process.env.FS_BLUEPRINT_NAME, process.env.FS_SYSTEM_NAME, process.env.FS_SERVICE_NAME]) { + if (!segment || !/^[a-z](?:[-a-z0-9]*[a-z0-9])?$/.test(segment)) break + dtinfoSidSegments.push(segment) + } + const dtinfoSid = dtinfoSidSegments.join('/') + const dtinfoEnvironment = process.env.FS_ENVIRONMENT_NAME || ({ int: 'dev', beta: 'test', prod: 'prod' })[process.env.FS_SYSTEM_NAME] || '' + %> + <% if (dtinfoSid) { %>window.dtinfo.sid = "<%= dtinfoSid %>"<% } %> + <% if (dtinfoEnvironment) { %>window.dtinfo.environment = "<%= dtinfoEnvironment %>"<% } %> // enableManualPageDetection is a RUM Classic API with no New RUM equivalent — New RUM models // navigations / page summaries / view summaries instead. Defer it until dtrum exists rather From ef0e1cea804da05368027f5e8fe828f5af79b143 Mon Sep 17 00:00:00 2001 From: Francisco Gongora Date: Thu, 19 Nov 2026 16:56:38 -0500 Subject: [PATCH 2/2] chore(release): @fs/react-scripts 8.19.0 (FRONTIER-5760) Co-Authored-By: Claude Opus 5.5 --- CHANGELOG-FRONTIER.md | 8 ++++++++ package-lock.json | 2 +- packages/react-scripts/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG-FRONTIER.md b/CHANGELOG-FRONTIER.md index 5205499f0db..89f4732f999 100644 --- a/CHANGELOG-FRONTIER.md +++ b/CHANGELOG-FRONTIER.md @@ -1,3 +1,11 @@ +## 8.19.0 + +- Render the primary Grail tag values on `window.dtinfo`, next to `appName`, so a per-frontend Dynatrace RUM capture rule can copy them onto user events as `event_properties.*` + - `window.dtinfo.sid` is `//` from `FS_BLUEPRINT_NAME`, `FS_SYSTEM_NAME` and `FS_SERVICE_NAME`, derived as `@fs/startup` 4.4.0 derives it for the dyno's processes so RUM and back-end records match. It stops at the first missing or malformed segment and is not set when the blueprint is missing + - `window.dtinfo.environment` is `FS_ENVIRONMENT_NAME`, or else `FS_SYSTEM_NAME` mapped `int→dev`, `beta→test`, `prod→prod`. An unmapped system leaves it unset rather than mislabelled. `TARGET_ENV` is never read + - Each global is set only when its value is non-empty, in the same unconditional block as `appName` (not behind `NODE_ENV` or the RUM flag) + - Each frontend still needs its own capture rule per key before the values reach Grail. `fsetgrp_id` is not rendered yet: the project group is not on the Heroku deploy path + ## 8.17.0 - Migrate to the Dynatrace New RUM Experience (RUM on Grail) and load the agent `async` diff --git a/package-lock.json b/package-lock.json index ebd31e8ccd5..e0df2d0a8e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37140,7 +37140,7 @@ }, "packages/react-scripts": { "name": "@fs/react-scripts", - "version": "8.17.0", + "version": "8.19.0", "license": "MIT", "dependencies": { "@babel/core": "^7.16.0", diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 588c4b1238f..fb271dccbb1 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@fs/react-scripts", - "version": "8.17.0", + "version": "8.19.0", "upstreamVersion": "5.0.1", "description": "Configuration and scripts for Create React App.", "repository": {