10.1 RUM Architecture, OneAgent Script Injection & Mobile/OpenKit Telemetry
Key Takeaways
- Real User Monitoring (RUM) passively captures 100% of live user interactions, browser performance timings, and client-side exceptions across web, mobile, and custom embedded applications.
- OneAgent automatically injects the Dynatrace JavaScript agent into HTML response streams at the web server tier, placing it directly inside the <head> tag before any other scripts to capture early navigation and resource timings.
- Agentless RUM and manual injection enable digital experience monitoring on uninstrumented web servers, static CDN buckets, and third-party SaaS platforms by embedding JavaScript snippets or deploying via Tag Managers.
- Browser beacons transmit telemetry back to Dynatrace via asynchronous W3C navigator.sendBeacon requests, routed either through the local OneAgent-monitored web server (/rb_...) or directly to an ActiveGate.
- Dynatrace OpenKit extends RUM capabilities to headless runtimes, embedded devices, POS terminals, and smart TVs, while mobile SDKs provide auto-instrumented crash, lifecycle, and network monitoring for native iOS and Android apps.
Digital Experience Monitoring (DEM) in Dynatrace provides end-to-end visibility into the availability, performance, and user satisfaction of digital services. While Synthetic Monitoring proactively simulates user interactions on scheduled intervals from public or private locations, Real User Monitoring (RUM) passively observes the actual experience of live human beings interacting with web applications, native mobile applications, and embedded digital interfaces.
RUM captures every page view, mouse click, touch gesture, asynchronous API call, client-side JavaScript error, and application crash in real time. For the Dynatrace Certified Associate examination, candidates must understand the mechanics of how the Dynatrace JavaScript agent is delivered to browsers, how telemetry beacons flow back to the monitoring cluster, and how non-browser workloads are instrumented using Mobile SDKs and OpenKit.
1. RUM vs. Synthetic Monitoring: Observability Paradigms
To build a robust digital experience strategy, enterprises combine synthetic probing with real user observation. Understanding the distinction between these two pillars is a recurring theme on the certification exam:
| Dimension | Real User Monitoring (RUM) | Synthetic Monitoring |
|---|---|---|
| Data Source | Actual live human visitors | Automated headless browser / HTTP test runners |
| Traffic Nature | Passive observation of variable user traffic | Proactive, scheduled, deterministic simulation |
| Coverage | Only captures pages visited by real users | Probes critical journeys 24/7, even during zero-traffic windows |
| Environment Context | Real device fragmentation, ISP latency, client CPU load | Controlled, clean, standardized execution environments |
| Backend Correlation | Stitches live user actions to backend PurePaths | Tags test runs with x-dynatrace-test into PurePaths |
| Root Cause Detection | Identifies geographic, browser, or demographic issues | Flags regional infrastructure outages and SLA breaches |
2. The Dynatrace JavaScript Agent: Core Architecture & Capabilities
At the core of web Real User Monitoring is the Dynatrace JavaScript agent (frequently referenced in source code as ruxitagentjs or customized script identifiers). This client-side agent is an optimized, high-performance monitoring library executed within the end user's browser runtime.
Core Responsibilities of the JavaScript Agent
- API Monkey-Patching: Upon initialization, the agent wraps native browser APIs, including
XMLHttpRequest,window.fetch,setTimeout,addEventListener, and history navigation (pushState,replaceState). This enables automatic capture of user interactions, asynchronous network traffic, and Single Page Application (SPA) routing without requiring application code changes. - W3C Timing Ingestion: Accesses the browser's native
window.performanceinterface to harvest granular W3C Navigation Timing and Resource Timing milestones. - Error & Exception Interception: Attaches listeners to
window.onerrorand unhandled Promise rejections (window.onunhandledrejection), capturing the stack trace, error message, and associated user action. - Visual Progression Tracking: Uses the
MutationObserverAPI to monitor Document Object Model (DOM) additions, deletions, and attribute modifications, computing visual metrics like Visually Complete and Speed Index.
Agent Flavors and Modules
Dynatrace offers multiple configurations of the JavaScript agent depending on monitoring requirements:
- Standard Agent: Captures W3C navigation timings, load actions, XHR/Fetch user actions, client errors, and Core Web Vitals.
- Advanced Agent with Session Replay: Includes the Session Replay module, which records DOM mutations, user input events, and mouse movements for high-fidelity visual session playback.
- Custom Extensions: Optional modules for specialized JavaScript frameworks (Angular, React, Vue.js, Dojo, Sencha ExtJS) that hook directly into framework-specific lifecycle events and routing engines.
3. OneAgent Automatic Script Injection Mechanics
When applications run on application servers or web servers instrumented with Dynatrace OneAgent (such as Apache HTTP Server, NGINX, Microsoft IIS, Node.js, IBM WebSphere, or Java Servlet containers), the JavaScript agent is delivered via automatic injection.
+---------------------------------------------------------------------------------------------------+
| ONEAGENT AUTOMATIC SCRIPT INJECTION FLOW |
+---------------------------------------------------------------------------------------------------+
| 1. BROWSER REQUESTS HTML |
| GET /products/item-482 HTTP/1.1 ──────────────────────────────────────────┐ |
| ▼ |
| 2. APPLICATION GENERATES RESPONSE [ ONEAGENT WEB SERVER MODULE ] |
| Backend service generates raw HTML: • Intercepts outbound HTML stream |
| <html><head><title>Store</title></head>... • Injects <script> into <head> |
| • Modifies Content-Length & ETag |
| │ |
| 3. MODIFIED HTML DELIVERED TO BROWSER ▼ |
| <html><head><script type="text/javascript" src="/ruxitagentjs_..."></script>... |
| |
| 4. BROWSER PARSES & EXECUTES AGENT |
| Agent initializes, wraps XHR/fetch, hooks W3C performance APIs, and monitors DOM mutations. |
+---------------------------------------------------------------------------------------------------+
Injection Location: The <head> Tag Imperative
OneAgent inspects outbound HTTP response streams with a MIME type of text/html. When an HTML document is detected, OneAgent dynamically modifies the byte stream on the fly, injecting the JavaScript agent reference directly into the <head> tag.
Exam Rule: The JavaScript agent must be injected as close to the opening
<head>tag as possible, preceding any other external scripts or stylesheets. Placing the agent at the bottom of the<body>tag or after application scripts causes critical blind spots: early resource timing events are missed, inline script errors throw before listeners are registered, and user clicks during page construction cannot be correlated.
Injection Formats
Dynatrace supports three injection formats configurable within Application Settings:
- Code Snippet (Standard / Deferred): Injects a small inline loader snippet that asynchronously downloads the main JavaScript agent library. This prevents blocking the browser's HTML parser while ensuring monitoring hooks are initialized early.
- Script Tag (Linked): Injects a standard
<script type="text/javascript" src="...">tag referencing the agent path on the origin web server. - Inline Code: Embeds the entire JavaScript agent code directly into the HTML payload. This format is utilized in high-security environments where Content Security Policy (CSP) headers forbid external script requests or where network round-trips for script files must be eliminated.
4. Agentless RUM and Manual Injection
While automatic injection is the preferred zero-touch approach, certain enterprise architectures do not permit OneAgent installation on the underlying host. Examples include:
- Static web applications hosted in object storage buckets (AWS S3, Azure Blob Storage, Google Cloud Storage) behind a Content Delivery Network (CloudFront, Akamai, Cloudflare).
- Third-party Software-as-a-Service (SaaS) platforms and customer portals where the operating system and web server layers are inaccessible.
- Legacy or proprietary web servers unsupported by OneAgent binaries.
Agentless Monitoring Mechanics
In these scenarios, organizations implement Agentless RUM:
- An administrator creates an Application in Dynatrace and selects Agentless Monitoring.
- Dynatrace generates a customized JavaScript code snippet.
- Developers paste this snippet into the master HTML page template, or configure a Tag Management System (such as Google Tag Manager, Adobe Launch, or Tealium) to fire the snippet on all page loads.
- Unlike automatic injection—where the agent updates automatically when OneAgent is updated—agentless snippets require manual updates or API-driven script refreshes to leverage new Dynatrace JavaScript agent capabilities.
5. Beacon Forwarding Architecture & Delivery Protocols
As users interact with an application, the JavaScript agent compiles performance measurements, error logs, and action timings into a structured binary or compressed payload called a RUM Beacon. Transmitting this data back to the Dynatrace platform requires a defined network path.
+---------------------------------------------------------------------------------------------------+
| RUM BEACON TRANSMISSION PATHWAYS |
+---------------------------------------------------------------------------------------------------+
| PATHWAY A: AUTOMATIC INJECTION (Via Monitored Web Server) |
| [ Browser ] ───POST /rb_bf12345───> [ Web Server / OneAgent ] ───Port 443───> [ ActiveGate ] |
| • OneAgent intercepts in memory |
| • Payload stripped before app routing |
| |
| PATHWAY B: AGENTLESS / CDN (Direct to ActiveGate) |
| [ Browser ] ───POST /bf/xxxxxxxx──> [ Reverse Proxy / ActiveGate ] ──Port 443──> [ Cluster ] |
| • Requires CORS configuration |
| • Needs public ActiveGate endpoint |
+---------------------------------------------------------------------------------------------------+
Pathway A: Relative Path Interception (Automatic Injection)
Under automatic injection, the browser sends beacon requests to the same origin server from which the web page was served, utilizing a relative URI path (e.g., https://example.com/rb_bf12345):
- In-Memory Interception: The OneAgent web server module intercepts the request at the web server layer (Apache, NGINX, IIS) before it reaches the application runtime or router.
- Zero Firewall Holes: Because beacons travel over the existing HTTP/HTTPS channel (ports 80/443) of the web application, no additional firewall rules, open ports, or proxy bypasses are required.
- Zero Application Footprint: The application backend never sees the beacon request; OneAgent extracts the payload and routes it upstream to an ActiveGate or Dynatrace Cluster.
Pathway B: Direct ActiveGate Transmission (Agentless & Custom Paths)
In agentless deployments or architectures where edge CDNs terminate connections without OneAgent:
- The beacon is addressed directly to a publicly exposed Environment ActiveGate or Dynatrace Cluster URL.
- CORS Configuration: Because the beacon is dispatched cross-origin (from
https://mycompany.comtohttps://activegate.mycompany.com), the ActiveGate must return appropriate Cross-Origin Resource Sharing (CORS) headers (Access-Control-Allow-Origin) to prevent browser security blocks.
Beacon Delivery Protocol: navigator.sendBeacon
To ensure reliable telemetry transmission without degrading the end user's browsing experience, the Dynatrace JavaScript agent leverages the modern W3C navigator.sendBeacon API:
- Non-Blocking Execution:
sendBeaconqueues data to be transmitted asynchronously by the browser process over HTTP POST. It does not compete with critical network requests for page assets. - Page Unload Survivability: Traditional
XMLHttpRequestcalls are abruptly killed by browsers when a user closes a tab, clicks a link to another site, or navigates away. ThesendBeaconAPI guarantees that telemetry queued during page unload or tab teardown is reliably dispatched by the browser even after the document has been fully destroyed. - Fallback Mechanism: If an older browser does not support
navigator.sendBeacon, the Dynatrace agent automatically falls back to standard asynchronousXMLHttpRequestorfetchcalls.
6. First-Party Cookies and Browser Storage Mechanics
To stitch disconnected user actions across multiple web pages into a coherent, contiguous User Session, the Dynatrace JavaScript agent manages several first-party cookies and session storage items:
| Cookie / Identifier | Purpose and Operational Mechanics |
|---|---|
rxVisitor | Stores a random, anonymized unique visitor identifier. Persists for 2 years to track returning visitors across multiple independent sessions. |
rxvt | Manages session timeout boundaries. Contains two timestamps: the current session start time and the sliding 30-minute inactivity expiration window. |
dtCookie | Maintains user session state and action sequence numbering across page loads on the same domain. |
dtPC | Dynamic context identifier containing server-side PurePath correlation IDs, page load IDs, and action sequence numbers. Injected into XHR/Fetch headers. |
dtLatC | Measures client-to-server network latency and timing offsets between the browser clock and server clock. |
Exam Key Point: Dynatrace RUM cookies are set as first-party cookies on the application's domain. They do not track users across third-party domains, ensuring full compliance with modern browser third-party cookie restrictions (such as Safari ITP and Chrome privacy sandboxes).
7. Mobile Application Monitoring: iOS and Android Telemetry
Mobile applications do not run in desktop web browsers; they operate as compiled native binaries on mobile operating systems (iOS and Android) or hybrid frameworks (React Native, Flutter, Cordova, Xamarin). Dynatrace instruments mobile applications via the Dynatrace Mobile SDK.
Automated Build-Time Instrumentation
Dynatrace provides build plugins that automatically instrument mobile code during compilation:
- Android: The Dynatrace Android Gradle plugin instruments compiled bytecode. It automatically wraps HTTP client libraries (OkHttp, HttpURLConnection), hooks Activity and Fragment lifecycle events, and captures UI click interactions without requiring manual code edits.
- iOS: The Dynatrace CocoaPods / Carthage / Swift Package Manager plugin automatically injects monitoring hooks into UIKit and SwiftUI view controllers and wraps
NSURLSessionfor network tracking.
Key Mobile Telemetry Dimensions
- App Start Time: Automatically measures the duration required for the application to launch and become interactable, broken down into:
- Cold Start: Application process is spawned from disk into memory (clean boot).
- Warm Start: Application process is resident in memory, but UI activity must be recreated.
- Hot Start: Application returns to the foreground from the background state.
- Crash & ANR Reporting: Captures unexpected application crashes and Android Application Not Responding (ANR) events, collecting stack traces, device memory states, and OS versions. Dynatrace utilizes uploaded symbolication files (dSYM for iOS; ProGuard / DexGuard / R8 mapping files for Android) to de-obfuscate raw memory addresses into readable source code file names and line numbers.
- Device and Environmental Context: Telemetry includes battery charge status, network connection type (WiFi, 4G, 5G), mobile carrier, device model, and operating system build.
8. OpenKit: Telemetry for Standalone, Embedded & IoT Devices
Modern digital ecosystems extend beyond web browsers and smartphones. Enterprises deploy customer-facing interfaces on point-of-sale (POS) terminals, smart TVs, airline kiosk displays, automotive infotainment consoles, medical devices, and desktop software (Java, .NET, C++).
Because these runtimes lack a standard HTML browser engine and cannot run mobile OS plugins, Dynatrace created OpenKit—an open-source, lightweight telemetry library that implements the Dynatrace RUM communication protocol.
OpenKit Capabilities and Architecture
- Multi-Language Support: Available as native libraries in Java, .NET, C++, Python, and JavaScript/TypeScript.
- Session Lifecycle Modeling: Allows developers to explicitly initialize sessions (
createSession()), start root user actions (enterAction()), attach sub-actions, log custom business metrics, and terminate sessions. - Error & Crash Logging: Explicitly reports handled errors, unhandled exceptions, and catastrophic application crashes directly into Dynatrace DEM analytics.
- Trace Propagation: Generates W3C Trace Context and Dynatrace correlation headers (
traceparent,x-dynatrace) that developers attach to outgoing HTTP requests, seamlessly linking embedded device actions directly to backend OneAgent PurePaths.
An enterprise web application runs behind a fleet of external reverse proxies and load balancers. OneAgent is installed on the backend Apache web servers, and automatic JavaScript injection is active. However, in the Dynatrace console, real user monitoring data is completely missing. Browser developer tools reveal that the JavaScript agent downloads successfully, but subsequent beacon requests to '/rb_bf12345' fail with HTTP 404 Not Found errors at the external proxy layer. What is the root cause of this failure, and how should it be resolved?
A global logistics firm operates three customer-facing touchpoints: a web-based shipment tracking portal running on Linux Tomcat servers monitored by OneAgent, a native mobile application on iOS and Android used by field drivers, and an embedded Java-based warehouse barcode scanner running on customized handheld Linux terminals without a web browser. The enterprise monitoring team needs to collect end-to-end user experience, error tracking, and backend PurePath correlation across all three client environments. Which combination of Dynatrace technologies provides the appropriate monitoring architecture?
An e-commerce engineering team opts for manual script injection on a high-traffic storefront. Developers paste the Dynatrace JavaScript agent snippet directly before the closing '</body>' tag at the bottom of the master HTML template. Following deployment, operations reports that while user sessions are recorded, initial page load timings lack early network milestones, inline JavaScript errors occurring during initial page rendering are missing, and Visually Complete calculations appear delayed. What architectural requirement was violated by this implementation?