diff --git a/CHANGELOG-FRONTIER.md b/CHANGELOG-FRONTIER.md index 4bea864366..143213a6f1 100644 --- a/CHANGELOG-FRONTIER.md +++ b/CHANGELOG-FRONTIER.md @@ -1,3 +1,17 @@ +## 8.17.0 + +- Upgrade Dynatrace RUM agent to version 1.329+ and enable new RUM experience + - Added feature flag `frontier_snow_dynatraceNewRUM` to control RUM version selection (gradual rollout); the existing `frontier_snow_dynatraceRUM` flag still selects the loading mechanism + - New RUM is loaded exclusively via ` - <% } else if (dynatraceFlag.treatment === 'asyncCS-inline') { %> - <%- include(`./partials/dynatrace/_inline_${env}`) %> + <% if (useNewRUM) { %> + + + <% } else { %> + + + <% } %> + <% } else if (dynatraceFlag.treatment === 'asyncCS-inline') { %> + <% if (useNewRUM) { %> + + + <% } else { %> + + <%- include(inlinePathOld) %> + <% } %> <% } else if (dynatraceFlag.treatment === 'global-cdn') { %> + <% if (useNewRUM) { %> + + + <% } else { %> + + <% } %> <% } %> - + <% } %> diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 98f1328c8a..aaff449610 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@fs/react-scripts", - "version": "8.16.1", + "version": "8.17.0", "upstreamVersion": "5.0.1", "description": "Configuration and scripts for Create React App.", "repository": { diff --git a/packages/react-scripts/scripts/DYNATRACE_RUM_UPDATE.md b/packages/react-scripts/scripts/DYNATRACE_RUM_UPDATE.md new file mode 100644 index 0000000000..4885b1a3c3 --- /dev/null +++ b/packages/react-scripts/scripts/DYNATRACE_RUM_UPDATE.md @@ -0,0 +1,177 @@ +# Updating Dynatrace RUM Scripts + +This guide explains how to update the Dynatrace RUM agent to a new version using the automated fetch script. + +## Quick Start + +```bash +export DYNATRACE_API_TOKEN="your-api-token" +node packages/react-scripts/scripts/fetch-dynatrace-scripts.js +``` + +The script will fetch the latest RUM scripts and CDN URLs for all three environments (int, beta, prod). + +## Prerequisites + +### 1. Get a Dynatrace API Token + +1. Log into your Dynatrace environment: https://bjm35087.live.dynatrace.com +2. Go to Account → Access Tokens +3. Create a new API token with these scopes: + - **Read RUM manual insertion tags** (API v2) - for fetching scripts + - **Real user monitoring JavaScript tag management** (API v1) - optional, for additional RUM data + +### 2. Know Your Entity IDs + +The script uses these default entity IDs: +- **Int**: `APPLICATION-3FAF90E849295814` +- **Beta**: `APPLICATION-C4242BB1EB216374` +- **Prod**: `APPLICATION-A8E5EDD77F861ACE` + +To find entity IDs yourself: +1. Log into Dynatrace +2. Go to Applications → select your app → Settings +3. The entity ID is shown in the URL or settings page + +## How to Use + +### Step 1: Fetch the Latest Scripts + +```bash +export DYNATRACE_API_TOKEN="your-token-here" +node packages/react-scripts/scripts/fetch-dynatrace-scripts.js +``` + +The script will: +1. ✅ **Update the new-RUM fallback values** in `dynatrace.ejs` (`cdnUrlsNew`, `cdnIntegrityNew`, `cdnConfigNew`, `cdnCompleteUrlsNew`) +2. ✅ **Write & publish** `dynatrace-rum-config.json` to S3 so Snow can supply fresh values via `locals.dynatrace.*` without a react-scripts redeploy +3. 🔒 **Capture the SRI integrity hashes** and `data-dtconfig` for each environment + +> **The new RUM agent is never inlined.** The script no longer fetches `/inlineCode` or writes `_inline_*_new.ejs` files. Reason: EJS `include()` compiles the included file as a template, and the new agent's minified JS contains the two-character EJS open-delimiter sequence (a `<` immediately followed by a `%`) inside a string, which EJS misreads as an unterminated scriptlet ("Could not find matching close tag"). It also re-ships 300–460 KB on every page view. The new RUM loads exclusively via ` +``` + +Key parts: +- **`src`**: The CDN URL for the external script +- **`data-dtconfig`**: Configuration string (includes app ID, parameters, etc.) +- **`integrity`**: SRI hash for script verification +- **app ID**: The environment-specific application identifier (e.g., `app=3faf90e849295814`) + +## Files Modified During Update + +``` +packages/react-scripts/layout/views/partials/dynatrace.ejs (fallback values auto-updated) +packages/react-scripts/scripts/dynatrace-rum-config.json (regenerated; also published to S3) +packages/react-scripts/package.json (version bump) +CHANGELOG-FRONTIER.md (add entry) +``` + +> Note: the new RUM does **not** generate `_inline_*_new.ejs` files (the agent is loaded via `