From f7c10e03ed80481364461f2a54edf88d41fbb812 Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Wed, 7 May 2025 13:30:24 -0500 Subject: [PATCH 01/13] Rename file --- .../guide/{proxy-rum-data.md => proxy-rum-data.mdoc.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename content/en/real_user_monitoring/guide/{proxy-rum-data.md => proxy-rum-data.mdoc.md} (100%) diff --git a/content/en/real_user_monitoring/guide/proxy-rum-data.md b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md similarity index 100% rename from content/en/real_user_monitoring/guide/proxy-rum-data.md rename to content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md From b9a827373c4f2b53d0194865e75aca18898c3dd4 Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Wed, 7 May 2025 13:39:34 -0500 Subject: [PATCH 02/13] Broaden the pkg_mgr trait to lib_src, to include CDNs etc --- customization_config/en/traits/traits.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/customization_config/en/traits/traits.yaml b/customization_config/en/traits/traits.yaml index a324e2f7c2206..66019c8ebcf28 100644 --- a/customization_config/en/traits/traits.yaml +++ b/customization_config/en/traits/traits.yaml @@ -30,6 +30,6 @@ traits: label: "OS" internal_notes: Mobile operating system, such as Android. - - id: pkg_mgr - label: "Package manager" - internal_notes: Software package manager, such as npm. \ No newline at end of file + - id: lib_src + label: "Source" + internal_notes: The source of a software library that the customer is trying to use in their code, such as an SDK. This is most often a package manager like NPM. But it could also have a more general value, like "CDN" or "GitHub". \ No newline at end of file From 22c19f948d36c72fe18b6ed025eed31dd7cb9e11 Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Wed, 7 May 2025 14:01:59 -0500 Subject: [PATCH 03/13] Add required config for new filter --- .../sdk.yaml => real_user_monitoring.yaml} | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) rename customization_config/en/option_groups/{real_user_monitoring/sdk.yaml => real_user_monitoring.yaml} (59%) diff --git a/customization_config/en/option_groups/real_user_monitoring/sdk.yaml b/customization_config/en/option_groups/real_user_monitoring.yaml similarity index 59% rename from customization_config/en/option_groups/real_user_monitoring/sdk.yaml rename to customization_config/en/option_groups/real_user_monitoring.yaml index 7f2759d6fadb7..0280b437bd2b9 100644 --- a/customization_config/en/option_groups/real_user_monitoring/sdk.yaml +++ b/customization_config/en/option_groups/real_user_monitoring.yaml @@ -7,4 +7,10 @@ rum_sdk_platform_options: rum_mobile_proxy_protocol_options: - id: http_https default: true - - id: socks \ No newline at end of file + - id: socks + +rum_browser_sdk_source_options: + - id: npm + default: true + - id: cdn_async + - id: cdn_sync \ No newline at end of file From 6aa9d14788a5690ae16fcf1f32840cc7b4781746 Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Wed, 7 May 2025 14:02:39 -0500 Subject: [PATCH 04/13] Convert Hugo shortcodes to Markdoc tags --- .../guide/proxy-rum-data.mdoc.md | 67 ++++++++++--------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md index c4d318e57374e..89e0968bacbda 100644 --- a/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md +++ b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md @@ -1,8 +1,11 @@ --- title: Proxy Your Browser RUM Data - aliases: - /real_user_monitoring/faq/proxy_rum_data/ +content_filters: + - trait_id: lib_src + option_group_id: rum_browser_sdk_source_options + label: "SDK source" further_reading: - link: '/real_user_monitoring/' tag: 'Documentation' @@ -22,13 +25,11 @@ To successfully forward a request to Datadog, your proxy must 3. Forward the request to the Datadog intake URL using the POST method. 4. Leave the request body unchanged. -
-
    -
  • For security reasons, remove any HTTP headers that potentially contain sensitive information, such as the cookie header.
  • -
  • The request body can contain binary data and should not be converted to a string. Make sure your proxy implementation forwards the raw body without conversion.
  • -
  • Make sure your proxy implementation does not allow a malicious actor to send requests to a different server (ex: https://browser-intake-datadoghq.com.malicious.com).
  • -
-
+{% alert level="warning" %} +- For security reasons, remove any HTTP headers that potentially contain sensitive information, such as the `cookie` header. +- The request body can contain binary data and should not be converted to a string. Make sure your proxy implementation forwards the raw body without conversion. +- Make sure your proxy implementation does not allow a malicious actor to send requests to a different server (ex: https://browser-intake-datadoghq.com.malicious.com). +{% /alert %} ### Build the Datadog intake URL @@ -55,9 +56,8 @@ The Datadog intake origins for each site are listed below: Configure the URL of the proxy in the `proxy` initialization parameter. The RUM Browser SDK adds a `ddforward` query parameter to all requests to your proxy. This query parameter contains the URL path and parameters that all data must be forwarded to. -{{< tabs >}} -{{% tab "NPM" %}} - + +{% if equals($lib_src, "npm") %} ```javascript import { Datacenter, datadogRum } from '@datadog/browser-rum'; @@ -68,9 +68,11 @@ datadogRum.init({ proxy: '', }); ``` +{% /if %} + -{{% /tab %}} -{{% tab "CDN async" %}} + +{% if equals($lib_src, "cdn_async") %} ```javascript window.DD_RUM.onReady(function() { window.DD_RUM.init({ @@ -80,9 +82,11 @@ window.DD_RUM.onReady(function() { }); }); ``` -{{% /tab %}} -{{% tab "CDN sync" %}} +{% /if %} + + +{% if equals($lib_src, "cdn_sync") %} ```javascript window.DD_RUM && window.DD_RUM.init({ @@ -91,9 +95,8 @@ window.DD_RUM && proxy: '' }); ``` - -{{% /tab %}} -{{< /tabs >}} +{% /if %} + For example, with a `site` set to `datadoghq.eu` and a `proxy` set to `https://example.org/datadog-intake-proxy`, the RUM Browser SDK sends requests to a URL like this: `https://example.org/datadog-intake-proxy?ddforward=%2Fapi%2Fv2%2Frum%3Fddsource%3Dbrowser`. The proxy forwards the request to `https://browser-intake-datadoghq.eu/api/v2/rum?ddsource=browser`. @@ -109,13 +112,12 @@ This function receives an object with the following properties: **Note**: - **JSP web applications** need to use the `\` escape character to properly propagate these parameters to the browser. For example: - ```javascript - proxy: (options) => 'http://proxyURL:proxyPort\${options.path}?\${options.parameters}', - ``` - -{{< tabs >}} -{{% tab "NPM" %}} + ```javascript + proxy: (options) => 'http://proxyURL:proxyPort\${options.path}?\${options.parameters}', + ``` + +{% if equals($lib_src, "npm") %} ```javascript import { Datacenter, datadogRum } from '@datadog/browser-rum'; @@ -126,9 +128,11 @@ datadogRum.init({ proxy: (options) => `https://www.proxy.com/foo${options.path}/bar?${options.parameters}`, }); ``` +{% /if %} + -{{% /tab %}} -{{% tab "CDN async" %}} + +{% if equals($lib_src, "cdn_async") %} ```javascript window.DD_RUM.onReady(function() { window.DD_RUM.init({ @@ -138,9 +142,11 @@ window.DD_RUM.onReady(function() { }) }) ``` -{{% /tab %}} -{{% tab "CDN sync" %}} +{% /if %} + + +{% if equals($lib_src, "cdn_sync") %} ```javascript window.DD_RUM && window.DD_RUM.init({ @@ -149,9 +155,8 @@ window.DD_RUM && proxy: (options) => `https://www.proxy.com/foo${options.path}/bar?${options.parameters}` }); ``` - -{{% /tab %}} -{{< /tabs >}} +{% /if %} + For example, with a `site` set to `datadoghq.eu` and the `proxy` configuration from the example, the RUM Browser SDK sends requests to an URL that looks this: `https://www.proxy.com/foo/api/v2/rum/bar?ddsource=browser`. The proxy will need to forward the request to the URL `https://browser-intake-datadoghq.eu/api/v2/rum?ddsource=browser`. From f6983bd1f5790656cb0aca972079a881f2577e09 Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Wed, 7 May 2025 14:05:02 -0500 Subject: [PATCH 05/13] Remove Further Reading section --- content/.gitignore | 2 ++ content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/content/.gitignore b/content/.gitignore index fdb635d0123b2..b193de93aa8e0 100644 --- a/content/.gitignore +++ b/content/.gitignore @@ -1,3 +1,5 @@ # GENERATED FILE: DO NOT EDIT # Ignore .md files compiled from Markdoc /en/real_user_monitoring/guide/proxy-mobile-rum-data.md + +/en/real_user_monitoring/guide/proxy-rum-data.md \ No newline at end of file diff --git a/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md index 89e0968bacbda..cdeb643f5bb59 100644 --- a/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md +++ b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md @@ -170,10 +170,6 @@ Before Browser SDK v4.34.0, the `proxyUrl` initialization parameter was used, an The Datadog intake origin needs to be defined in your proxy implementation to ensure security. If you are still using a proxy with an older version of the Browser SDK, upgrade to a newer version of the Browser SDK to avoid vulnerabilities. -## Further Reading - -{{< partial name="whats-next/whats-next.html" >}} - [1]: /real_user_monitoring/browser/setup/#initialization-parameters [2]: https://github.com/easylist/easylist/blob/997fb6533c719a015c21723b34e0cedefcc0d83d/easyprivacy/easyprivacy_general.txt#L3840 From 5f0c9824fa7db8119b6b9750078a1b7050738418 Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Wed, 7 May 2025 14:13:20 -0500 Subject: [PATCH 06/13] Add a trait for the RUM browser SDK version --- customization_config/en/options/version_numbers.yaml | 0 customization_config/en/traits/{traits.yaml => general.yaml} | 2 +- customization_config/en/traits/software_versions.yaml | 4 ++++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 customization_config/en/options/version_numbers.yaml rename customization_config/en/traits/{traits.yaml => general.yaml} (97%) create mode 100644 customization_config/en/traits/software_versions.yaml diff --git a/customization_config/en/options/version_numbers.yaml b/customization_config/en/options/version_numbers.yaml new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/customization_config/en/traits/traits.yaml b/customization_config/en/traits/general.yaml similarity index 97% rename from customization_config/en/traits/traits.yaml rename to customization_config/en/traits/general.yaml index 66019c8ebcf28..0aba5737616d6 100644 --- a/customization_config/en/traits/traits.yaml +++ b/customization_config/en/traits/general.yaml @@ -32,4 +32,4 @@ traits: - id: lib_src label: "Source" - internal_notes: The source of a software library that the customer is trying to use in their code, such as an SDK. This is most often a package manager like NPM. But it could also have a more general value, like "CDN" or "GitHub". \ No newline at end of file + internal_notes: The source of a software library that the customer is trying to use in their code, such as an SDK. This is most often a package manager like NPM. But it could also have a more general value, like "CDN" or "GitHub". diff --git a/customization_config/en/traits/software_versions.yaml b/customization_config/en/traits/software_versions.yaml new file mode 100644 index 0000000000000..c4544050a0d67 --- /dev/null +++ b/customization_config/en/traits/software_versions.yaml @@ -0,0 +1,4 @@ +traits: + - id: rum_browser_sdk_version + label: "SDK version" + internal_notes: The customer's version of the RUM browser SDK. Its value should be a semantic version represented in snake case, such as "1_2_3", "lt_1_2_3", "gt_1_2_3", "lte_1_2_3", etc. \ No newline at end of file From 482bdaf9cbf2e48171f3a91389a612f76ed16c3e Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Wed, 7 May 2025 14:21:28 -0500 Subject: [PATCH 07/13] Update customization config to support version numbers --- .../en/options/{options.yaml => general.yaml} | 1 + .../en/options/version_numbers.yaml | 13 +++++ customization_config/en/traits/general.yaml | 56 +++++++++---------- .../en/traits/software_versions.yaml | 7 ++- 4 files changed, 46 insertions(+), 31 deletions(-) rename customization_config/en/options/{options.yaml => general.yaml} (99%) diff --git a/customization_config/en/options/options.yaml b/customization_config/en/options/general.yaml similarity index 99% rename from customization_config/en/options/options.yaml rename to customization_config/en/options/general.yaml index 40007fa83f874..2234e3f4b73aa 100644 --- a/customization_config/en/options/options.yaml +++ b/customization_config/en/options/general.yaml @@ -12,6 +12,7 @@ # and give it a unique ID. options: + - label: .NET id: dot_net diff --git a/customization_config/en/options/version_numbers.yaml b/customization_config/en/options/version_numbers.yaml index e69de29bb2d1d..3961cc945fe85 100644 --- a/customization_config/en/options/version_numbers.yaml +++ b/customization_config/en/options/version_numbers.yaml @@ -0,0 +1,13 @@ +options: + +# Earlier than 4.34.0 +- label: "<4.34.0" + id: lt_4_34_0 + +# 4.34.0 or later +- label: ">=4.34.0" + id: gte_4_34_0 + +# 5.4.0 or later +- label: ">=5.4.0" + id: gte_5_4_0 \ No newline at end of file diff --git a/customization_config/en/traits/general.yaml b/customization_config/en/traits/general.yaml index 0aba5737616d6..5fcb65480bfec 100644 --- a/customization_config/en/traits/general.yaml +++ b/customization_config/en/traits/general.yaml @@ -1,35 +1,35 @@ traits: - - id: prog_lang - label: Programming Language - internal_notes: Do not use for frameworks like Next or React Native. Instead, use `env`. +- id: prog_lang + label: Programming Language + internal_notes: Do not use for frameworks like Next or React Native. Instead, use `env`. - - id: protocol - label: Protocol - internal_notes: For example, HTTP, gRPC, or SOCKS. +- id: protocol + label: Protocol + internal_notes: For example, HTTP, gRPC, or SOCKS. - - id: platform - label: "Platform" - internal_notes: The target platform (language, framework, specific env) for a library, SDK, or other third-party entity. Do not use if every option is a pure programming language (Go, Python, etc.) -- use `prog_lang` instead. Re-label to "Framework", "SDK", etc. if it's more appropriate for your context. - - - id: host - label: "Host" - internal_notes: Hosting platform, such as AWS or GCP. Can also refer to containers like Kubernetes. +- id: platform + label: "Platform" + internal_notes: The target platform (language, framework, specific env) for a library, SDK, or other third-party entity. Do not use if every option is a pure programming language (Go, Python, etc.) -- use `prog_lang` instead. Re-label to "Framework", "SDK", etc. if it's more appropriate for your context. + +- id: host + label: "Host" + internal_notes: Hosting platform, such as AWS or GCP. Can also refer to containers like Kubernetes. - - id: host_type - label: "Host type" - internal_notes: The machine or container type within a given host, such as EC2. Use only as a followup to a `host` selection. +- id: host_type + label: "Host type" + internal_notes: The machine or container type within a given host, such as EC2. Use only as a followup to a `host` selection. - - id: os - label: "OS" - internal_notes: Env operating system, such as Linux or Windows. Can refer to a mobile OS, but `mobile_os` is preferred for lists of mobile-only options. +- id: os + label: "OS" + internal_notes: Env operating system, such as Linux or Windows. Can refer to a mobile OS, but `mobile_os` is preferred for lists of mobile-only options. - - id: database - label: "Database" +- id: database + label: "Database" - - id: mobile_os - label: "OS" - internal_notes: Mobile operating system, such as Android. - - - id: lib_src - label: "Source" - internal_notes: The source of a software library that the customer is trying to use in their code, such as an SDK. This is most often a package manager like NPM. But it could also have a more general value, like "CDN" or "GitHub". +- id: mobile_os + label: "OS" + internal_notes: Mobile operating system, such as Android. + +- id: lib_src + label: "Source" + internal_notes: The source of a software library that the customer is trying to use in their code, such as an SDK. This is most often a package manager like NPM. But it could also have a more general value, like "CDN" or "GitHub". \ No newline at end of file diff --git a/customization_config/en/traits/software_versions.yaml b/customization_config/en/traits/software_versions.yaml index c4544050a0d67..75a0081dadd71 100644 --- a/customization_config/en/traits/software_versions.yaml +++ b/customization_config/en/traits/software_versions.yaml @@ -1,4 +1,5 @@ traits: - - id: rum_browser_sdk_version - label: "SDK version" - internal_notes: The customer's version of the RUM browser SDK. Its value should be a semantic version represented in snake case, such as "1_2_3", "lt_1_2_3", "gt_1_2_3", "lte_1_2_3", etc. \ No newline at end of file + +- id: rum_browser_sdk_version + label: "SDK version" + internal_notes: The customer's version of the RUM browser SDK. Its value should be a semantic version represented in snake case, such as "1_2_3", "lt_1_2_3", "gt_1_2_3", "lte_1_2_3", etc. From 11d89e95cd0a8332d923ead186595fa662523c85 Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Wed, 7 May 2025 17:12:55 -0500 Subject: [PATCH 08/13] Finish content migration --- .../guide/proxy-rum-data.mdoc.md | 46 +++++++++++++------ .../option_groups/real_user_monitoring.yaml | 8 +++- 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md index cdeb643f5bb59..157a6731429bf 100644 --- a/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md +++ b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md @@ -6,12 +6,20 @@ content_filters: - trait_id: lib_src option_group_id: rum_browser_sdk_source_options label: "SDK source" + - trait_id: rum_browser_sdk_version + option_group_id: rum_browser_sdk_version_for_proxying_options further_reading: - link: '/real_user_monitoring/' tag: 'Documentation' text: 'Learn about Real User Monitoring' --- +{% if equals($rum_browser_sdk_version, "lt_4_34_0") %} +{% alert level="danger" %} +Upgrade to Browser SDK `4.34.0` or later to avoid security vulnerabilities in your proxy configuration. +{% /alert %} +{% /if %} + ## Overview The RUM Browser SDK can be configured to send requests through a proxy. When you set the SDK's `proxy` [initialization parameter][1] to a URL such as `https://www.example-proxy.com/any-endpoint`, all RUM data is sent to that URL using the POST method. The RUM data still needs to be forwarded to Datadog from the proxy. @@ -52,7 +60,10 @@ The Datadog intake origins for each site are listed below: | US1-FED | `ddog-gov.com` | `https://browser-intake-ddog-gov.com` | | AP1 | `ap1.datadoghq.com` | `https://browser-intake-ap1-datadoghq.com` | -## Recommended SDK setup +## SDK setup + + +{% if or(equals($rum_browser_sdk_version, "gte_5_4_0"),equals($rum_browser_sdk_version, "gte_4_34_0")) %} Configure the URL of the proxy in the `proxy` initialization parameter. The RUM Browser SDK adds a `ddforward` query parameter to all requests to your proxy. This query parameter contains the URL path and parameters that all data must be forwarded to. @@ -82,6 +93,7 @@ window.DD_RUM.onReady(function() { }); }); ``` + {% /if %} @@ -100,22 +112,17 @@ window.DD_RUM && For example, with a `site` set to `datadoghq.eu` and a `proxy` set to `https://example.org/datadog-intake-proxy`, the RUM Browser SDK sends requests to a URL like this: `https://example.org/datadog-intake-proxy?ddforward=%2Fapi%2Fv2%2Frum%3Fddsource%3Dbrowser`. The proxy forwards the request to `https://browser-intake-datadoghq.eu/api/v2/rum?ddsource=browser`. -## Alternate SDK setup + +{% if equals($rum_browser_sdk_version, "gte_5_4_0") %} +### Passing a function to the `proxy` initialization parameter -From Browser SDK v5.4.0, the `proxy` initialization parameter supports a function input. This function allows you to have more control on how the path and parameters are added to the proxy URL. +The `proxy` initialization parameter also supports a function input. This function allows you to have more control on how the path and parameters are added to the proxy URL. This function receives an object with the following properties: - `path`: the path for the Datadog requests (example: `/api/v2/rum`) - `parameters`: the parameters of the Datadog requests (example: `ddsource=browser&...`) -**Note**: - -- **JSP web applications** need to use the `\` escape character to properly propagate these parameters to the browser. For example: - ```javascript - proxy: (options) => 'http://proxyURL:proxyPort\${options.path}?\${options.parameters}', - ``` - {% if equals($lib_src, "npm") %} ```javascript @@ -163,14 +170,25 @@ For example, with a `site` set to `datadoghq.eu` and the `proxy` configuration f **Note:** - Some privacy blockers already target the intake [URL patterns][2], so you may want to take that into account when building your proxy URL. - The `proxy` function is called for each request, so it should avoid any heavy computation. +- **JSP web applications** need to use the `\` escape character to properly propagate these parameters to the browser. For example: + ```javascript + proxy: (options) => 'http://proxyURL:proxyPort\${options.path}?\${options.parameters}', + ``` +{% /if %} + -## Legacy SDK setup (<4.34.0) +{% /if %} + + +{% if equals($rum_browser_sdk_version, "lt_4_34_0") %} Before Browser SDK v4.34.0, the `proxyUrl` initialization parameter was used, and the Datadog intake origin was included in the `ddforward` attribute. The proxy implementation was in charge of validating this host, and failure to do so resulted in various vulnerabilities. -The Datadog intake origin needs to be defined in your proxy implementation to ensure security. If you are still using a proxy with an older version of the Browser SDK, upgrade to a newer version of the Browser SDK to avoid vulnerabilities. +The Datadog intake origin needs to be defined in your proxy implementation to ensure security. + +**To avoid security vulnerabilities, you must upgrade to Browser SDK `4.34.0` or later.** +{% /if %} + [1]: /real_user_monitoring/browser/setup/#initialization-parameters [2]: https://github.com/easylist/easylist/blob/997fb6533c719a015c21723b34e0cedefcc0d83d/easyprivacy/easyprivacy_general.txt#L3840 - - diff --git a/customization_config/en/option_groups/real_user_monitoring.yaml b/customization_config/en/option_groups/real_user_monitoring.yaml index 0280b437bd2b9..0636ed77ba2f7 100644 --- a/customization_config/en/option_groups/real_user_monitoring.yaml +++ b/customization_config/en/option_groups/real_user_monitoring.yaml @@ -13,4 +13,10 @@ rum_browser_sdk_source_options: - id: npm default: true - id: cdn_async - - id: cdn_sync \ No newline at end of file + - id: cdn_sync + +rum_browser_sdk_version_for_proxying_options: +- id: gte_5_4_0 + default: true +- id: gte_4_34_0 +- id: lt_4_34_0 \ No newline at end of file From 016dc102a316dbf354b14ca7274a5972bbf4181b Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Thu, 8 May 2025 11:42:02 -0500 Subject: [PATCH 09/13] Customize content for the customer's DD site --- .../guide/proxy-rum-data.mdoc.md | 61 +++++++++++++------ 1 file changed, 43 insertions(+), 18 deletions(-) diff --git a/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md index 157a6731429bf..4a962bc16e308 100644 --- a/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md +++ b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md @@ -41,24 +41,49 @@ To successfully forward a request to Datadog, your proxy must ### Build the Datadog intake URL -A Datadog intake URL (example: `https://browser-intake-datadoghq.eu/api/v2/rum?ddsource=browser&...`) has three parts: +Your Datadog intake URL should have the format `/` (for example, `https://browser-intake-datadoghq.eu/api/v2/rum?ddsource=browser&...`). -- the Datadog intake origin corresponding to your `site` [initialization parameter][1] (example: `https://browser-intake-datadoghq.eu`) -- the path containing the API version and the product (example: `/api/v2/rum` for RUM data or `/api/v2/replay` for Session Replay data) -- the parameters (example: `ddsource=browser&...`) +{% table %} +--- +* intake origin +* + The Datadog intake origin corresponds to your `site` [initialization parameter][1]. The Datadog intake origin corresponding to your site parameter should be defined in your proxy implementation. + + {% site-region region="us" %} + The intake origin for your Datadog site is `https://browser-intake-datadoghq.com`. + {% /site-region %} + + {% site-region region="us3" %} + The intake origin for your Datadog site is `https://browser-intake-us3-datadoghq.com`. + {% /site-region %} + + {% site-region region="us5" %} + The intake origin for your Datadog site is `https://browser-intake-us5-datadoghq.com`. + {% /site-region %} -The Datadog intake origin corresponding to your `site` parameter should be defined in your proxy implementation. The path and parameters for each request sent to the proxy can be accessed in the request's `ddforward` parameter (for example, `https://www.example-proxy.com/any-endpoint?ddforward=%2Fapi%2Fv2%2Frum%3Fddsource%3Dbrowser`). + {% site-region region="eu" %} + The intake origin for your Datadog site is `https://browser-intake-datadoghq.eu`. + {% /site-region %} -The Datadog intake origins for each site are listed below: + {% site-region region="ap1" %} + The intake origin for your Datadog site is `https://browser-intake-ap1-datadoghq.com`. + {% /site-region %} + + {% site-region region="fed" %} + The intake origin for your Datadog site is `https://browser-intake-ddog-gov.com`. + {% /site-region %} +--- +* path +* + The path contains the API version and the product (for example, `/api/v2/rum` for RUM data or `/api/v2/replay` for Session Replay data). + + The path for each request can be accessed in the request's `ddforward` parameter (for example, `https://www.example-proxy.com/any-endpoint?ddforward=%2Fapi%2Fv2%2Frum%3Fddsource%3Dbrowser`). +--- +* parameters +* + The request parameters (for example, `ddsource=browser&...`) can be accessed in the request's `ddforward` parameter (for example, `https://www.example-proxy.com/any-endpoint?ddforward=%2Fapi%2Fv2%2Frum%3Fddsource%3Dbrowser`). -| Site | Site Parameter | Datadog intake origin | -|---------|---------------------------|--------------------------------------------| -| US1 | `datadoghq.com` (default) | `https://browser-intake-datadoghq.com` | -| US3 | `us3.datadoghq.com` | `https://browser-intake-us3-datadoghq.com` | -| US5 | `us5.datadoghq.com` | `https://browser-intake-us5-datadoghq.com` | -| EU1 | `datadoghq.eu` | `https://browser-intake-datadoghq.eu` | -| US1-FED | `ddog-gov.com` | `https://browser-intake-ddog-gov.com` | -| AP1 | `ap1.datadoghq.com` | `https://browser-intake-ap1-datadoghq.com` | +{% /table %} ## SDK setup @@ -75,7 +100,7 @@ import { Datacenter, datadogRum } from '@datadog/browser-rum'; datadogRum.init({ applicationId: '', clientToken: '', - site: '', + site: '{% region-param key="dd_site" /%}', proxy: '', }); ``` @@ -131,7 +156,7 @@ import { Datacenter, datadogRum } from '@datadog/browser-rum'; datadogRum.init({ applicationId: '', clientToken: '', - site: '', + site: '{% region-param key="dd_site" /%}', proxy: (options) => `https://www.proxy.com/foo${options.path}/bar?${options.parameters}`, }); ``` @@ -165,7 +190,7 @@ window.DD_RUM && {% /if %} -For example, with a `site` set to `datadoghq.eu` and the `proxy` configuration from the example, the RUM Browser SDK sends requests to an URL that looks this: `https://www.proxy.com/foo/api/v2/rum/bar?ddsource=browser`. The proxy will need to forward the request to the URL `https://browser-intake-datadoghq.eu/api/v2/rum?ddsource=browser`. +For example, with a `site` set to `datadoghq.eu` and the `proxy` configuration from the example, the RUM Browser SDK sends requests to an URL that looks like this: `https://www.proxy.com/foo/api/v2/rum/bar?ddsource=browser`. The proxy will need to forward the request to the URL `https://browser-intake-datadoghq.eu/api/v2/rum?ddsource=browser`. **Note:** - Some privacy blockers already target the intake [URL patterns][2], so you may want to take that into account when building your proxy URL. @@ -190,5 +215,5 @@ The Datadog intake origin needs to be defined in your proxy implementation to en {% /if %} -[1]: /real_user_monitoring/browser/setup/#initialization-parameters +[1]: /real_user_monitoring/browser/setup/client/?tab=rum#initialization-parameters [2]: https://github.com/easylist/easylist/blob/997fb6533c719a015c21723b34e0cedefcc0d83d/easyprivacy/easyprivacy_general.txt#L3840 From d33f5f7a366c4625810c94775bdf612dd6e5abe7 Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Thu, 8 May 2025 11:48:30 -0500 Subject: [PATCH 10/13] Remove duplicate paragraph --- content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md index 4a962bc16e308..c63fef3c36318 100644 --- a/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md +++ b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md @@ -190,8 +190,6 @@ window.DD_RUM && {% /if %} -For example, with a `site` set to `datadoghq.eu` and the `proxy` configuration from the example, the RUM Browser SDK sends requests to an URL that looks like this: `https://www.proxy.com/foo/api/v2/rum/bar?ddsource=browser`. The proxy will need to forward the request to the URL `https://browser-intake-datadoghq.eu/api/v2/rum?ddsource=browser`. - **Note:** - Some privacy blockers already target the intake [URL patterns][2], so you may want to take that into account when building your proxy URL. - The `proxy` function is called for each request, so it should avoid any heavy computation. From d3c52056240aff362f8d2046269e1a61e9c1eb15 Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Thu, 8 May 2025 11:49:37 -0500 Subject: [PATCH 11/13] Use newest Cdocs integration version --- package.json | 2 +- yarn.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 763d5396d3be1..87fe576101ada 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@popperjs/core": "^2.11.8", "alpinejs": "^3.13.7", "bootstrap": "^5.2", - "cdocs-hugo-integration": "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.5.tgz", + "cdocs-hugo-integration": "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.8.tgz", "del": "4.1.1", "fancy-log": "^1.3.3", "geo-locate": "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/geo-locate-v1.0.1.tgz", diff --git a/yarn.lock b/yarn.lock index 898a8b3d7a3e1..fd55595cb8172 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6520,9 +6520,9 @@ __metadata: languageName: node linkType: hard -"cdocs-data@https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-data-v1.0.2.tgz": - version: 1.0.2 - resolution: "cdocs-data@https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-data-v1.0.2.tgz" +"cdocs-data@https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-data-v1.0.3.tgz": + version: 1.0.3 + resolution: "cdocs-data@https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-data-v1.0.3.tgz" dependencies: js-yaml: ^4.1.0 jsdom: ^26.0.0 @@ -6532,18 +6532,18 @@ __metadata: typedoc-plugin-zod: ^1.3.1 uuid: ^11.0.5 zod: ^3.22.4 - checksum: 69058b63360bcce5274879bd4da2b4b20e253f3ce6a8a4d9fdff15b94118ca8e8fad21601be9cce58a849cf963f1adb8bac094c708f06041b15c9940fa76b4e1 + checksum: e6825dd85817ccb4f91879d0e86a0cd46982571a5508d2a3c8df4e9c7d5bb5eec5b84020bfd01b8f945e64958082de4a9c00dbc147e2f5a19b92af9a3b72d026 languageName: node linkType: hard -"cdocs-hugo-integration@https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.5.tgz": - version: 1.1.5 - resolution: "cdocs-hugo-integration@https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.5.tgz" +"cdocs-hugo-integration@https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.8.tgz": + version: 1.1.8 + resolution: "cdocs-hugo-integration@https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.8.tgz" dependencies: "@prettier/sync": ^0.5.2 "@types/markdown-it": ^14.1.2 "@vitejs/plugin-react": ^4.3.3 - cdocs-data: "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-data-v1.0.2.tgz" + cdocs-data: "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-data-v1.0.3.tgz" cdocs-markdoc: "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-markdoc-v1.0.1.tgz" chroma-highlight: ^2.4.2 interweave: ^13.1.0 @@ -6562,7 +6562,7 @@ __metadata: vite: ^5.4.10 vite-plugin-singlefile: ^2.0.2 zod: ^3.22.4 - checksum: 371991f1c07385f3b781317f590e05c6dd8f323f5575a7b8e6d9e70627a357d76574bfaead52cfcbea8b5fe3c18cb1830ebf2d77ac285685a449e401859b7df0 + checksum: 5735e9969b385ac20875463ad83eb531f1296624745338eca743c74c2f4f550108a70b5db6222da7cd5a3176fae7cadfaa93c31bf08b63729e1291ab9d3a810c languageName: node linkType: hard @@ -7595,7 +7595,7 @@ __metadata: acorn: ^7.4.1 alpinejs: ^3.13.7 bootstrap: ^5.2 - cdocs-hugo-integration: "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.5.tgz" + cdocs-hugo-integration: "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.8.tgz" cross-env: ^5.2.1 del: 4.1.1 eslint: ^6.8.0 From 9210b206740d9a5bbc84f86b2690be0a481f4db8 Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Thu, 8 May 2025 11:58:51 -0500 Subject: [PATCH 12/13] Tweak content order --- content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md index c63fef3c36318..7e1373329d932 100644 --- a/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md +++ b/content/en/real_user_monitoring/guide/proxy-rum-data.mdoc.md @@ -90,7 +90,7 @@ Your Datadog intake URL should have the format `/4.34.0 and up --> {% if or(equals($rum_browser_sdk_version, "gte_5_4_0"),equals($rum_browser_sdk_version, "gte_4_34_0")) %} -Configure the URL of the proxy in the `proxy` initialization parameter. The RUM Browser SDK adds a `ddforward` query parameter to all requests to your proxy. This query parameter contains the URL path and parameters that all data must be forwarded to. +Configure the URL of the proxy in the `proxy` initialization parameter: {% if equals($lib_src, "npm") %} @@ -135,6 +135,8 @@ window.DD_RUM && {% /if %} +The RUM Browser SDK adds a `ddforward` query parameter to all requests to your proxy. This query parameter contains the URL path and parameters that all data must be forwarded to. + For example, with a `site` set to `datadoghq.eu` and a `proxy` set to `https://example.org/datadog-intake-proxy`, the RUM Browser SDK sends requests to a URL like this: `https://example.org/datadog-intake-proxy?ddforward=%2Fapi%2Fv2%2Frum%3Fddsource%3Dbrowser`. The proxy forwards the request to `https://browser-intake-datadoghq.eu/api/v2/rum?ddsource=browser`. From bc65bb11f5a7e6222b817981556ecdd378d4cb43 Mon Sep 17 00:00:00 2001 From: Jen Gilbert Date: Thu, 8 May 2025 17:00:41 -0500 Subject: [PATCH 13/13] Update Cdocs integration version --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 87fe576101ada..b05ab486b1581 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@popperjs/core": "^2.11.8", "alpinejs": "^3.13.7", "bootstrap": "^5.2", - "cdocs-hugo-integration": "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.8.tgz", + "cdocs-hugo-integration": "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.9.tgz", "del": "4.1.1", "fancy-log": "^1.3.3", "geo-locate": "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/geo-locate-v1.0.1.tgz", diff --git a/yarn.lock b/yarn.lock index fd55595cb8172..54493a6bea747 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6536,9 +6536,9 @@ __metadata: languageName: node linkType: hard -"cdocs-hugo-integration@https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.8.tgz": - version: 1.1.8 - resolution: "cdocs-hugo-integration@https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.8.tgz" +"cdocs-hugo-integration@https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.9.tgz": + version: 1.1.9 + resolution: "cdocs-hugo-integration@https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.9.tgz" dependencies: "@prettier/sync": ^0.5.2 "@types/markdown-it": ^14.1.2 @@ -6562,7 +6562,7 @@ __metadata: vite: ^5.4.10 vite-plugin-singlefile: ^2.0.2 zod: ^3.22.4 - checksum: 5735e9969b385ac20875463ad83eb531f1296624745338eca743c74c2f4f550108a70b5db6222da7cd5a3176fae7cadfaa93c31bf08b63729e1291ab9d3a810c + checksum: 98ec8f23adf4058c97ed8ea94b1611276c016889c0d89f8621e6a6e4cec8773e82e4f8645d5f2b66799017e24776f88d8cfa1e212d8265c8cbf468d693db995a languageName: node linkType: hard @@ -7595,7 +7595,7 @@ __metadata: acorn: ^7.4.1 alpinejs: ^3.13.7 bootstrap: ^5.2 - cdocs-hugo-integration: "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.8.tgz" + cdocs-hugo-integration: "https://s3.amazonaws.com/origin-static-assets/corp-node-packages/master/cdocs-hugo-integration-v1.1.9.tgz" cross-env: ^5.2.1 del: 4.1.1 eslint: ^6.8.0