Proxy Real User Monitoring Data

Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.

The Real User Monitoring (RUM) SDK can be configured to send requests through a proxy. Requests made still need to be forwarded to Datadog.

SDK initialization

When you set the proxyUrl initialization parameter, all RUM data is sent to the specified URL using the POST method (for example,

import { Datacenter, datadogRum } from '@datadog/browser-rum';

    applicationId: '<DATADOG_APPLICATION_ID>',
    clientToken: '<DATADOG_CLIENT_TOKEN>',
    site: '<DATADOG_SITE>',
    proxyUrl: '<YOUR_PROXY_URL>',
 (function(h,o,u,n,d) {
  DD_RUM.onReady(function() {
        clientToken: '<CLIENT_TOKEN>',
        applicationId: '<APPLICATION_ID>',
        proxyUrl: '<YOUR_PROXY_URL>',
window.DD_RUM &&
        clientToken: '<CLIENT_TOKEN>',
        applicationId: '<APPLICATION_ID>',
        proxyUrl: '<YOUR_PROXY_URL>',

Proxy setup

When your proxy receives data from the RUM SDK, it must be forwarded to Datadog. The RUM SDK adds the ddforward query parameter to all POST requests to your proxy. This query parameter contains the URL where all data must be forwarded to.

To successfully proxy request to Datadog:

  1. Add a X-Forwarded-For header containing the request client IP address, for accurate geoIP.
  2. Forward the request to the URL set in the ddforward query parameter using the POST method.

Note: The request body must remain unchanged.