Skip to content

Commit

Permalink
Adapt RUM server onboarding to include httpd
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomartinezbernardo committed Feb 4, 2025
1 parent 8fad7af commit f0af487
Showing 1 changed file with 83 additions and 2 deletions.
85 changes: 83 additions & 2 deletions content/en/real_user_monitoring/browser/setup/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The available functionality has the following important limitations:

- If proxying compressed traffic, the Auto-Instrumentation method is not able to inject the JS scriptlet into the HTML traffic.
- This instrumentation method does not support any [advanced RUM configurations][3]. However, `allowedTracingUrls` and `excludedActivityUrls` are supported for NGINX web servers.
- If NGINX or IIS is acting as a proxy and the upstream server has end-to-end encryption (like TLS) enabled, the module cannot inject RUM. Ensure the web server is set up for TLS origination for successful instrumentation.
- If acting as a proxy and the upstream server has end-to-end encryption (like TLS) enabled, the module cannot inject RUM. Ensure the web server is set up for TLS origination for successful instrumentation.
- (Windows IIS only) Configuration for Auto-Instrumentation is only available per Windows IIS site.

## Prerequisites
Expand Down Expand Up @@ -115,6 +115,75 @@ To automatically instrument your RUM application:

{{% /collapse-content %}}

{{% /tab %}}
{{% tab "httpd" %}}

The Auto-Instrumentation method leverages the [Apache httpd Modules capability][1] to implement a response body filter. The filter injects the RUM SDK into the response body for responses
identified as HTML. For more granular control over how configuration files or permissions are handled, you can also install Apache httpd Server manually.

[1]: https://httpd.apache.org/modules/#apache-httpd-modules


{{% collapse-content title="Automatic installation (recommended)" level="h5" %}}

To automatically instrument your RUM application:

1. In Datadog, navigate to the [**Digital Experience > Add an Application Page**][1] and select the JavaScript (JS) application type.
2. Select **Auto-Instrumentation** and **httpd**.
3. Set your Session and Session Replay sample rates. See [guidance on configuring sampling][2].
4. Copy and run the installer command to load the Datadog httpd Module with the RUM SDK Injector onto httpd.
5. After the installer successfully installs the SDK Injector, restart httpd to begin collecting RUM sessions.
6. (Optional) To verify the module is successfully injecting the RUM Browser SDK into HTML pages, check the NGINX error logs for relevant messages. The module logs important steps during the injection process. Ensure that httpd is configured with at least the `info` log level.

[1]: https://app.datadoghq.com/rum/list
[2]: /real_user_monitoring/guide/sampling-browser-plans/

{{% /collapse-content %}}

{{% collapse-content title="Manual configuration" level="h5" %}}

### Download the module file

1. Download the [zipped module][1].
2. Extract the zip to obtain the `mod_datadog.so` file. Move it to a location that httpd has access to (referenced as `<RUM_MODULE_PATH>` in the steps below).

[1]: https://rum-auto-instrumentation.s3.amazonaws.com/httpd/latest/mod_datadog-amd64.zip

### Update httpd configuration
1. Locate the configuration file. You can use `apachectl -V` to see the configuration path. Add the following line to load the module:

```javascript
LoadModule datadog_module <RUM_MODULE_PATH>
```

2. Then in the appropriate **root or location** section, add the following:

```javascript
# APM Tracing is enabled by default. The following line disables APM Tracing.
DatadogTracing Off
DatadogRum On
<DatadogRumSettings>
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

1. Restart the httpd 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.
2. (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 httpd is configured with at least the `info` log level.

{{% /collapse-content %}}

{{% /tab %}}
{{% tab "Windows IIS" %}}

Expand Down Expand Up @@ -162,7 +231,19 @@ To update your RUM Application:

1. Go to your RUM application from the [Application Management][1] list.
2. On the Instrument your application page, adjust the slider or enter a specific percentage in the input box for Session Sampling or Session Replay Sampling.
3. Copy and run the installer command in your `NGINX.conf` file.
3. Copy and paste the code snippet to your `NGINX.conf` file.

[1]: https://app.datadoghq.com/rum/list

{{% /tab %}}

{{% tab "httpd" %}}

To update your RUM Application:

1. Go to your RUM application from the [Application Management][1] list.
2. On the Instrument your application page, adjust the slider or enter a specific percentage in the input box for Session Sampling or Session Replay Sampling.
3. Copy and paste the code snippet to your `/opt/datadog-httpd/datadog.conf` file.

[1]: https://app.datadoghq.com/rum/list

Expand Down

0 comments on commit f0af487

Please sign in to comment.