To try the preview for RUM Auto-Instrumentation, follow the instructions on this page.
Overview
RUM Auto-Instrumentation works by injecting the RUM Browser SDK into the HTML responses being served through a web server or proxy. This method leverages the IBM httpd Modules capability to implement a response body filter. The filter injects the RUM Browser SDK into the response body for responses
identified as HTML. After auto-instrumentation is set up, you can manage configurations from the UI.
To understand important limitations and compatibility requirements, see Limitations.
Prerequisites
The Datadog Agent is installed and configured.
Set up your RUM application
To automatically instrument your RUM application:
- In Datadog, navigate to the Digital Experience > Manage Applications Page, click on New Application, and select the JavaScript (JS) application type.
- Select Auto-Instrumentation and IBM httpd.
- Configure your application parameters. See guidance on configuring sampling.
- Copy and run the installer command to load the Datadog httpd Module with the RUM SDK Injector onto httpd.
- After the installer successfully installs the SDK Injector, restart IBM HTTP Server to begin collecting RUM sessions.
- (Optional) To verify the module is successfully injecting the RUM Browser SDK into HTML pages, check the error logs for relevant messages. The module logs important steps during the injection process. Ensure that IBM HTTP Server is configured with at least the
info log level.
Alternatively, you can manually install and configure the module.
Updating your RUM application
You can update your RUM application settings at any time. From the Application Management list, select your RUM application and navigate to the SDK Configuration page. Click Save Changes after making updates.
Sampling rates
Adjust the slider or enter a specific percentage in the input box for Session Sampling or Session Replay Sampling. Copy and paste the configuration snippet to your /opt/datadog-httpd/datadog.conf file.
User attributes
You can update user attributes to associate RUM sessions with specific users and track their activity across your application.
Select a source type (JavaScript path, CSS selector for DOM, or cookie) and configure a regex extractor to parse user ID, user name, and user email.
Troubleshooting
RUM is not injected
If you notice that RUM is not being injected into HTML pages, consider the following potential causes:
- Content-Type mismatch: RUM is injected only into HTML pages. If the
Content-Type header does not correctly indicate text/html, the injection is skipped.
Limitations
See other Limitations.
Uninstall
To manually remove RUM from your auto-instrumented web server:
- Locate the IBM HTTP server (
httpd) configuration file by running httpd -V. Depending on the Linux distribution used, this binary file could be named http, apachectl, apache2 or apache2ctl. The following steps use httpd as an example. In this instance, the file location could be: /usr/local/apache2/conf/httpd.conf. - At the end of the file, remove the line:
Include /opt/datadog-httpd/datadog.conf. - Delete the directory
/opt/datadog-httpd/ and all of its contents. - Restart or reload the IBM HTTP Server.
Alternative installation method
If you need finer control over more parameters than what the automatic instrumentation provides, you can manually load the module onto your web server instead of running the installation script.
To manually instrument your RUM application:
Download the module file
- Download the zipped module.
- Extract the zip to obtain the
mod_datadog.so file. Move it to a location that IBM HTTP Server has access to (referenced as <RUM_MODULE_PATH> in the steps below).
Update IBM HTTP server configuration
Locate the configuration file. You can use apachectl -V to find the default configuration path. Add the following line to load the module:
LoadModule datadog_module <RUM_MODULE_PATH>
Within the appropriate root or location section, add the following:
# APM Tracing is enabled by default. The following line disables APM Tracing
DatadogTracing Off
DatadogRum On
<DatadogRumSettings "v6">
DatadogRumOption "applicationId" "<DATADOG_APPLICATION_ID>"
DatadogRumOption "clientToken" "<DATADOG_CLIENT_TOKEN>"
DatadogRumOption "site" "<DATADOG_SITE>"
DatadogRumOption "service" "my-web-application"
DatadogRumOption "env" "production"
DatadogRumOption "version" "1.0.0"
DatadogRumOption "sessionSampleRate" "100"
DatadogRumOption "sessionReplaySampleRate" "100"
DatadogRumOption "trackResources" "true"
DatadogRumOption "trackLongTasks" "true"
DatadogRumOption "trackUserInteractions" "true"
</DatadogRumSettings>
Restart your server
- Restart the IBM HTTP Server to begin collecting data for your Datadog RUM application. By default, the RUM SDK is injected to all HTML documents. You may need to clear your browser cache.
- (Optional) To verify the module is successfully injecting the RUM Browser SDK into HTML pages, check the httpd error logs for relevant messages. The module logs important steps during the injection process. Ensure that IBM HTTP Server is configured with at least the
info log level.
Further reading
Additional helpful documentation, links, and articles: