From 99dc5bd3e4e93c67628700c1d3de5df1a5947209 Mon Sep 17 00:00:00 2001 From: hestonhoffman Date: Mon, 10 Nov 2025 11:55:14 -0800 Subject: [PATCH 1/4] Update CI-pipelines for DC --- assets/scripts/config/regions.config.js | 21 + .../pipelines/jenkins.md | 742 +++--------------- 2 files changed, 135 insertions(+), 628 deletions(-) diff --git a/assets/scripts/config/regions.config.js b/assets/scripts/config/regions.config.js index 812c6fe6f2222..c1d6c30740383 100644 --- a/assets/scripts/config/regions.config.js +++ b/assets/scripts/config/regions.config.js @@ -542,5 +542,26 @@ export default { ap1: 'config.ap1.datadoghq.com', ap2: 'violet.intake.ap2.datadoghq.com', gov: 'config.ddog-gov.com' +<<<<<<< Updated upstream +======= + }, + org_management_max_session_duration: { + us: '720 hours (30 days)', + us3: '720 hours (30 days)', + us5: '720 hours (30 days)', + eu: '720 hours (30 days)', + ap1: '720 hours (30 days)', + ap2: '720 hours (30 days)', + gov: '12 hours' + }, + jenkins_site_name: { + us: 'US1', + us3: 'US3', + us5: 'US5', + eu: 'EU1', + ap1: 'AP1', + ap2: 'AP2', + gov: 'US1_FED' +>>>>>>> Stashed changes } }; diff --git a/content/en/continuous_integration/pipelines/jenkins.md b/content/en/continuous_integration/pipelines/jenkins.md index ce617195946c1..1dccaea7cd480 100644 --- a/content/en/continuous_integration/pipelines/jenkins.md +++ b/content/en/continuous_integration/pipelines/jenkins.md @@ -78,8 +78,27 @@ There are several ways you can configure the Datadog Jenkins plugin. ### Configure with the Jenkins configuration UI -{{< tabs >}} -{{% tab "Agentless (using an API key)" %}} +#### Report through the Datadog Agent (recommended) + +1. In your Jenkins instance web interface, go to **Manage Jenkins > Configure System**. +2. Go to the `Datadog Plugin` section, scrolling down the configuration screen. +3. Select the mode `Use the Datadog Agent to report to Datadog`. +4. Configure the `Agent` host. +5. Configure CI Visibility: + 1. Configure the `Traces Collection Port` if not using the default port `8126`. + 2. Click the `Test traces connection` button to verify that your configuration is valid. + 3. Enable the `Enable CI Visibility` checkbox. + 4. (Optional) Configure your CI Instance name. +6. (Optional) Configure logs collection: + 1. Configure the `Log Collection` port as configured in the Datadog Agent. + 2. Click the `Test logs connection` button to verify that your configuration is valid. + 3. Enable the `Enable Log Collection` checkbox. +7. (Optional) Enter the name of the host that you use to access Datadog UI (for example, `app.datadoghq.com`) in the `Datadog App hostname` field. +8. Save your configuration. + +{{< img src="ci/ci-jenkins-plugin-config-agentful-app-hostname.png" alt="Datadog Plugin configuration for Jenkins" style="width:100%;">}} + +#### Agentless (using an API key) Use this option to make the Jenkins plugin report directly to Datadog without using the Datadog Agent. It requires an API Key. @@ -100,54 +119,29 @@ Use this option to make the Jenkins plugin report directly to Datadog without us {{< img src="ci/ci-jenkins-plugin-config-agentless-app-hostname.png" alt="Datadog Plugin configuration for Jenkins" style="width:100%;">}} [1]: /getting_started/site/#access-the-datadog-site -{{% /tab %}} -{{% tab "Report through the Datadog Agent (recommended)" %}} - -1. In your Jenkins instance web interface, go to **Manage Jenkins > Configure System**. -2. Go to the `Datadog Plugin` section, scrolling down the configuration screen. -3. Select the mode `Use the Datadog Agent to report to Datadog`. -4. Configure the `Agent` host. -5. Configure CI Visibility: - 1. Configure the `Traces Collection Port` if not using the default port `8126`. - 2. Click the `Test traces connection` button to verify that your configuration is valid. - 3. Enable the `Enable CI Visibility` checkbox. - 4. (Optional) Configure your CI Instance name. -6. (Optional) Configure logs collection: - 1. Configure the `Log Collection` port as configured in the Datadog Agent. - 2. Click the `Test logs connection` button to verify that your configuration is valid. - 3. Enable the `Enable Log Collection` checkbox. -7. (Optional) Enter the name of the host that you use to access Datadog UI (for example, `app.datadoghq.com`) in the `Datadog App hostname` field. -8. Save your configuration. - -{{< img src="ci/ci-jenkins-plugin-config-agentful-app-hostname.png" alt="Datadog Plugin configuration for Jenkins" style="width:100%;">}} -{{% /tab %}} -{{< /tabs >}} ### Use Configuration-as-Code -{{< tabs >}} - -{{% tab "Agentless (using an API key)" %}} +#### Report through the Datadog Agent (recommended) If your Jenkins instance uses the Jenkins [`configuration-as-code`][1] plugin: 1. Create or modify the configuration YAML by adding an entry for `datadogGlobalConfiguration`: - {{% site-region region="us" %}} - {{< code-block lang="yaml" disable_copy="true" collapsible="true" >}} +```yaml unclassified: datadogGlobalConfiguration: datadogClientConfiguration: - # Select the `Agentless` mode (using API key). - datadogApiConfiguration: - intake: - datadogIntakeSite: - # Configure your Datadog site - site: 'US1' - apiKey: - datadogCredentialsApiKey: - # Configure ID of Jenkins credentials that store your API key - credentialsId: 'my-api-key-credentials-id' + # Select the `Datadog Agent` mode + datadogAgentConfiguration: + # Configure Datadog Agent host + agentHost: '' + # Configure Datadog Agent port + agentPort: 8125 + # (Optional) Configure logs collection port as configured in your Datadog Agent + agentLogCollectionPort: 10518 + # Configure traces collection port + agentTraceCollectionPort: 8126 # Enable CI Visibility flag enableCiVisibility: true # (Optional) Configure your CI Instance name @@ -156,146 +150,21 @@ unclassified: datadogAppHostname: 'app.datadoghq.com' # (Optional) Enable logs collection collectBuildLogs: true - {{< /code-block >}} - - {{% /site-region %}} - {{% site-region region="eu" %}} - - {{< code-block lang="yaml" disable_copy="true" collapsible="true" >}} -unclassified: - datadogGlobalConfiguration: - datadogClientConfiguration: - # Select the `Agentless` mode (using API key). - datadogApiConfiguration: - intake: - datadogIntakeSite: - # Configure your Datadog site - site: 'EU1' - apiKey: - datadogCredentialsApiKey: - # Configure ID of Jenkins credentials that store your API key - credentialsId: 'my-api-key-credentials-id' - # Enable CI Visibility flag - enableCiVisibility: true - # (Optional) Configure your CI Instance name - ciInstanceName: 'jenkins' - # (Optional) Configure the name of the host that you use to access Datadog UI - datadogAppHostname: 'app.datadoghq.eu' - # (Optional) Enable logs collection - collectBuildLogs: true - {{< /code-block >}} - - {{% /site-region %}} - {{% site-region region="gov" %}} - - {{< code-block lang="yaml" disable_copy="true" collapsible="true" >}} -unclassified: - datadogGlobalConfiguration: - datadogClientConfiguration: - # Select the `Agentless` mode (using API key). - datadogApiConfiguration: - intake: - datadogIntakeSite: - # Configure your Datadog site - site: 'US1_FED' - apiKey: - datadogCredentialsApiKey: - # Configure ID of Jenkins credentials that store your API key - credentialsId: 'my-api-key-credentials-id' - # Enable CI Visibility flag - enableCiVisibility: true - # (Optional) Configure your CI Instance name - ciInstanceName: 'jenkins' - # (Optional) Configure the name of the host that you use to access Datadog UI - datadogAppHostname: 'app.ddog-gov.com' - # (Optional) Enable logs collection - collectBuildLogs: true - {{< /code-block >}} - - {{% /site-region %}} - {{% site-region region="us3" %}} +``` - {{< code-block lang="yaml" disable_copy="true" collapsible="true" >}} -unclassified: - datadogGlobalConfiguration: - datadogClientConfiguration: - # Select the `Agentless` mode (using API key). - datadogApiConfiguration: - intake: - datadogIntakeSite: - # Configure your Datadog site - site: 'US3' - apiKey: - datadogCredentialsApiKey: - # Configure ID of Jenkins credentials that store your API key - credentialsId: 'my-api-key-credentials-id' - # Enable CI Visibility flag - enableCiVisibility: true - # (Optional) Configure the name of the host that you use to access Datadog UI - ciInstanceName: 'jenkins' - # (Optional) Configure your Datadog app hostname - datadogAppHostname: 'app.us3.datadoghq.com' - # (Optional) Enable logs collection - collectBuildLogs: true - {{< /code-block >}} +2. In your Jenkins instance web interface, go to **Manage Jenkins > Configuration as Code**. +3. Apply or reload the configuration. +4. Check the configuration using the `View Configuration` button. - {{% /site-region %}} - {{% site-region region="us5" %}} +[1]: https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/README.md - {{< code-block lang="yaml" disable_copy="true" collapsible="true" >}} -unclassified: - datadogGlobalConfiguration: - datadogClientConfiguration: - # Select the `Agentless` mode (using API key). - datadogApiConfiguration: - intake: - datadogIntakeSite: - # Configure your Datadog site - site: 'US5' - apiKey: - datadogCredentialsApiKey: - # Configure ID of Jenkins credentials that store your API key - credentialsId: 'my-api-key-credentials-id' - # Enable CI Visibility flag - enableCiVisibility: true - # (Optional) Configure your CI Instance name - ciInstanceName: 'jenkins' - # (Optional) Configure the name of the host that you use to access Datadog UI - datadogAppHostname: 'app.us5.datadoghq.com' - # (Optional) Enable logs collection - collectBuildLogs: true - {{< /code-block >}} +#### Agentless (using an API key) - {{% /site-region %}} - {{% site-region region="ap1" %}} +If your Jenkins instance uses the Jenkins [`configuration-as-code`][1] plugin: - {{< code-block lang="yaml" disable_copy="true" collapsible="true" >}} -unclassified: - datadogGlobalConfiguration: - datadogClientConfiguration: - # Select the `Agentless` mode (using API key). - datadogApiConfiguration: - intake: - datadogIntakeSite: - # Configure your Datadog site - site: 'AP1' - apiKey: - datadogCredentialsApiKey: - # Configure ID of Jenkins credentials that store your API key - credentialsId: 'my-api-key-credentials-id' - # Enable CI Visibility flag - enableCiVisibility: true - # (Optional) Configure your CI Instance name - ciInstanceName: 'jenkins' - # (Optional) Configure the name of the host that you use to access Datadog UI - datadogAppHostname: 'app.ap1.datadoghq.com' - # (Optional) Enable logs collection - collectBuildLogs: true - {{< /code-block >}} - {{% /site-region %}} - {{% site-region region="ap2" %}} +1. Create or modify the configuration YAML by adding an entry for `datadogGlobalConfiguration`: - {{< code-block lang="yaml" disable_copy="true" collapsible="true" >}} +```yaml unclassified: datadogGlobalConfiguration: datadogClientConfiguration: @@ -304,7 +173,7 @@ unclassified: intake: datadogIntakeSite: # Configure your Datadog site - site: 'AP2' + site: '{{< region-param key=jenkins_site_name >}}' apiKey: datadogCredentialsApiKey: # Configure ID of Jenkins credentials that store your API key @@ -314,47 +183,10 @@ unclassified: # (Optional) Configure your CI Instance name ciInstanceName: 'jenkins' # (Optional) Configure the name of the host that you use to access Datadog UI - datadogAppHostname: 'app.ap2.datadoghq.com' + datadogAppHostname: '{{< region-param key=dd_full_site >}}' # (Optional) Enable logs collection collectBuildLogs: true - {{< /code-block >}} - {{% /site-region %}} - -2. In your Jenkins instance web interface, go to **Manage Jenkins > Configuration as Code**. -3. Apply or reload the configuration. -4. Check the configuration using the `View Configuration` button. - -[1]: https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/README.md -{{% /tab %}} -{{% tab "Report through the Datadog Agent (recommended)" %}} - -If your Jenkins instance uses the Jenkins [`configuration-as-code`][1] plugin: - -1. Create or modify the configuration YAML by adding an entry for `datadogGlobalConfiguration`: - - {{< code-block lang="yaml" disable_copy="true" collapsible="true" >}} -unclassified: - datadogGlobalConfiguration: - datadogClientConfiguration: - # Select the `Datadog Agent` mode - datadogAgentConfiguration: - # Configure Datadog Agent host - agentHost: '' - # Configure Datadog Agent port - agentPort: 8125 - # (Optional) Configure logs collection port as configured in your Datadog Agent - agentLogCollectionPort: 10518 - # Configure traces collection port - agentTraceCollectionPort: 8126 - # Enable CI Visibility flag - enableCiVisibility: true - # (Optional) Configure your CI Instance name - ciInstanceName: 'jenkins' - # (Optional) Configure the name of the host that you use to access Datadog UI - datadogAppHostname: 'app.datadoghq.com' - # (Optional) Enable logs collection - collectBuildLogs: true - {{< /code-block >}} +``` 2. In your Jenkins instance web interface, go to **Manage Jenkins > Configuration as Code**. 3. Apply or reload the configuration. @@ -362,33 +194,26 @@ unclassified: [1]: https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/README.md -{{% /tab %}} -{{< /tabs >}} - ### Configure with Groovy -{{< tabs >}} -{{% tab "Agentless (using an API key)" %}} +#### Report through the Datadog Agent (recommended) 1. In your Jenkins instance web interface, go to **Manage Jenkins > Script Console**. 2. Run the configuration script: - {{% site-region region="us" %}} - {{< code-block lang="groovy" disable_copy="true" collapsible="true" >}} -import hudson.util.Secret +```groovy import jenkins.model.Jenkins import org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.DatadogApiConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.api.intake.DatadogIntakeSite -import org.datadog.jenkins.plugins.datadog.configuration.api.intake.DatadogSite -import org.datadog.jenkins.plugins.datadog.configuration.api.key.DatadogTextApiKey +import org.datadog.jenkins.plugins.datadog.configuration.DatadogAgentConfiguration def jenkins = Jenkins.getInstance() def datadog = jenkins.getDescriptorByType(DatadogGlobalConfiguration) -def site = new DatadogIntakeSite(DatadogSite.US1) // Pick your Datadog site -def apiKey = new DatadogTextApiKey(Secret.fromString('')) // or `new DatadogCredentialsApiKey('')` -datadog.datadogClientConfiguration = new DatadogApiConfiguration(site, apiKey) +def agentHost = 'localhost' // Configure your Datadog Agent host +def agentPort = 8125 +def agentLogCollectionPort = 10518 // (Optional) Configure logs collection port as configured in your Datadog Agent +def agentTraceCollectionPort = 8126 // Configure traces collection port +datadog.datadogClientConfiguration = new DatadogAgentConfiguration(agentHost, agentPort, agentLogCollectionPort, agentTraceCollectionPort) datadog.datadogAppHostname = 'app.datadoghq.com' // the name of the host that you use to access Datadog UI datadog.enableCiVisibility = true @@ -398,157 +223,14 @@ datadog.ciInstanceName = 'jenkins' // (Optional) Set your CI Instance name // Save config datadog.save() - {{< /code-block >}} - - {{% /site-region %}} - {{% site-region region="eu" %}} - - {{< code-block lang="groovy" disable_copy="true" collapsible="true" >}} -import hudson.util.Secret -import jenkins.model.Jenkins -import org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.DatadogApiConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.api.intake.DatadogIntakeSite -import org.datadog.jenkins.plugins.datadog.configuration.api.intake.DatadogSite -import org.datadog.jenkins.plugins.datadog.configuration.api.key.DatadogTextApiKey - -def jenkins = Jenkins.getInstance() -def datadog = jenkins.getDescriptorByType(DatadogGlobalConfiguration) - -def site = new DatadogIntakeSite(DatadogSite.EU1) // Pick your Datadog site -def apiKey = new DatadogTextApiKey(Secret.fromString('')) // or `new DatadogCredentialsApiKey('')` -datadog.datadogClientConfiguration = new DatadogApiConfiguration(site, apiKey) - -datadog.datadogAppHostname = 'app.datadoghq.eu' // the name of the host that you use to access Datadog UI -datadog.enableCiVisibility = true -datadog.collectBuildLogs = true // (Optional) Enable logs collection - -datadog.ciInstanceName = 'jenkins' // (Optional) Set your CI Instance name - -// Save config -datadog.save() - {{< /code-block >}} - - {{% /site-region %}} - {{% site-region region="gov" %}} - - {{< code-block lang="groovy" disable_copy="true" collapsible="true" >}} -import hudson.util.Secret -import jenkins.model.Jenkins -import org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.DatadogApiConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.api.intake.DatadogIntakeSite -import org.datadog.jenkins.plugins.datadog.configuration.api.intake.DatadogSite -import org.datadog.jenkins.plugins.datadog.configuration.api.key.DatadogTextApiKey - -def jenkins = Jenkins.getInstance() -def datadog = jenkins.getDescriptorByType(DatadogGlobalConfiguration) - -def site = new DatadogIntakeSite(DatadogSite.US1_FED) // Pick your Datadog site -def apiKey = new DatadogTextApiKey(Secret.fromString('')) // or `new DatadogCredentialsApiKey('')` -datadog.datadogClientConfiguration = new DatadogApiConfiguration(site, apiKey) - -datadog.datadogAppHostname = 'app.ddog-gov.com' // the name of the host that you use to access Datadog UI -datadog.enableCiVisibility = true -datadog.collectBuildLogs = true // (Optional) Enable logs collection - -datadog.ciInstanceName = 'jenkins' // (Optional) Set your CI Instance name - -// Save config -datadog.save() - {{< /code-block >}} - - {{% /site-region %}} - {{% site-region region="us3" %}} - - {{< code-block lang="groovy" disable_copy="true" collapsible="true" >}} -import hudson.util.Secret -import jenkins.model.Jenkins -import org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.DatadogApiConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.api.intake.DatadogIntakeSite -import org.datadog.jenkins.plugins.datadog.configuration.api.intake.DatadogSite -import org.datadog.jenkins.plugins.datadog.configuration.api.key.DatadogTextApiKey - -def jenkins = Jenkins.getInstance() -def datadog = jenkins.getDescriptorByType(DatadogGlobalConfiguration) - -def site = new DatadogIntakeSite(DatadogSite.US3) // Pick your Datadog site -def apiKey = new DatadogTextApiKey(Secret.fromString('')) // or `new DatadogCredentialsApiKey('')` -datadog.datadogClientConfiguration = new DatadogApiConfiguration(site, apiKey) - -datadog.datadogAppHostname = 'app.us3.datadoghq.com' // the name of the host that you use to access Datadog UI -datadog.enableCiVisibility = true -datadog.collectBuildLogs = true // (Optional) Enable logs collection - -datadog.ciInstanceName = 'jenkins' // (Optional) Set your CI Instance name - -// Save config -datadog.save() - {{< /code-block >}} - - {{% /site-region %}} - {{% site-region region="us5" %}} - - {{< code-block lang="groovy" disable_copy="true" collapsible="true" >}} -import hudson.util.Secret -import jenkins.model.Jenkins -import org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.DatadogApiConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.api.intake.DatadogIntakeSite -import org.datadog.jenkins.plugins.datadog.configuration.api.intake.DatadogSite -import org.datadog.jenkins.plugins.datadog.configuration.api.key.DatadogTextApiKey - -def jenkins = Jenkins.getInstance() -def datadog = jenkins.getDescriptorByType(DatadogGlobalConfiguration) - -def site = new DatadogIntakeSite(DatadogSite.US5) // Pick your Datadog site -def apiKey = new DatadogTextApiKey(Secret.fromString('')) // or `new DatadogCredentialsApiKey('')` -datadog.datadogClientConfiguration = new DatadogApiConfiguration(site, apiKey) - -datadog.datadogAppHostname = 'app.us5.datadoghq.com' // the name of the host that you use to access Datadog UI -datadog.enableCiVisibility = true -datadog.collectBuildLogs = true // (Optional) Enable logs collection - -datadog.ciInstanceName = 'jenkins' // (Optional) Set your CI Instance name - -// Save config -datadog.save() - {{< /code-block >}} - - {{% /site-region %}} - {{% site-region region="ap1" %}} - - {{< code-block lang="groovy" disable_copy="true" collapsible="true" >}} -import hudson.util.Secret -import jenkins.model.Jenkins -import org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.DatadogApiConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.api.intake.DatadogIntakeSite -import org.datadog.jenkins.plugins.datadog.configuration.api.intake.DatadogSite -import org.datadog.jenkins.plugins.datadog.configuration.api.key.DatadogTextApiKey - -def jenkins = Jenkins.getInstance() -def datadog = jenkins.getDescriptorByType(DatadogGlobalConfiguration) - -def site = new DatadogIntakeSite(DatadogSite.AP1) // Pick your Datadog site -def apiKey = new DatadogTextApiKey(Secret.fromString('')) // or `new DatadogCredentialsApiKey('')` -datadog.datadogClientConfiguration = new DatadogApiConfiguration(site, apiKey) - -datadog.datadogAppHostname = 'app.ap1.datadoghq.com' // the name of the host that you use to access Datadog UI -datadog.enableCiVisibility = true -datadog.collectBuildLogs = true // (Optional) Enable logs collection - -datadog.ciInstanceName = 'jenkins' // (Optional) Set your CI Instance name +``` -// Save config -datadog.save() - {{< /code-block >}} +#### Agentless (using an API key) - {{% /site-region %}} - {{% site-region region="ap2" %}} +1. In your Jenkins instance web interface, go to **Manage Jenkins > Script Console**. +2. Run the configuration script: - {{< code-block lang="groovy" disable_copy="true" collapsible="true" >}} +```groovy import hudson.util.Secret import jenkins.model.Jenkins import org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration @@ -560,11 +242,11 @@ import org.datadog.jenkins.plugins.datadog.configuration.api.key.DatadogTextApiK def jenkins = Jenkins.getInstance() def datadog = jenkins.getDescriptorByType(DatadogGlobalConfiguration) -def site = new DatadogIntakeSite(DatadogSite.AP2) // Pick your Datadog site +def site = new DatadogIntakeSite(DatadogSite.{{< region-param key=jenkins_site_name >}}) // Pick your Datadog site def apiKey = new DatadogTextApiKey(Secret.fromString('')) // or `new DatadogCredentialsApiKey('')` datadog.datadogClientConfiguration = new DatadogApiConfiguration(site, apiKey) -datadog.datadogAppHostname = 'app.ap2.datadoghq.com' // the name of the host that you use to access Datadog UI +datadog.datadogAppHostname = '{{< region-param key=dd_full_site >}}' // the name of the host that you use to access Datadog UI datadog.enableCiVisibility = true datadog.collectBuildLogs = true // (Optional) Enable logs collection @@ -572,268 +254,71 @@ datadog.ciInstanceName = 'jenkins' // (Optional) Set your CI Instance name // Save config datadog.save() - {{< /code-block >}} - - {{% /site-region %}} - -{{% /tab %}} -{{% tab "Report through the Datadog Agent (recommended)" %}} - -1. In your Jenkins instance web interface, go to **Manage Jenkins > Script Console**. -2. Run the configuration script: - - {{< code-block lang="groovy" disable_copy="true" collapsible="true" >}} -import jenkins.model.Jenkins -import org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration -import org.datadog.jenkins.plugins.datadog.configuration.DatadogAgentConfiguration - -def jenkins = Jenkins.getInstance() -def datadog = jenkins.getDescriptorByType(DatadogGlobalConfiguration) - -def agentHost = 'localhost' // Configure your Datadog Agent host -def agentPort = 8125 -def agentLogCollectionPort = 10518 // (Optional) Configure logs collection port as configured in your Datadog Agent -def agentTraceCollectionPort = 8126 // Configure traces collection port -datadog.datadogClientConfiguration = new DatadogAgentConfiguration(agentHost, agentPort, agentLogCollectionPort, agentTraceCollectionPort) - -datadog.datadogAppHostname = 'app.datadoghq.com' // the name of the host that you use to access Datadog UI -datadog.enableCiVisibility = true -datadog.collectBuildLogs = true // (Optional) Enable logs collection - -datadog.ciInstanceName = 'jenkins' // (Optional) Set your CI Instance name - -// Save config -datadog.save() - {{< /code-block >}} - -{{% /tab %}} -{{< /tabs >}} +``` ### Use environment variables -{{< tabs >}} -{{% tab "Agentless (using an API key)" %}} +#### Report through the Datadog Agent (recommended) 1. Set the following environment variables on your Jenkins instance machine: - {{% site-region region="us" %}} - {{< code-block lang="bash" disable_copy="true" collapsible="true" >}} - # Select the Datadog Agent mode - DATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP - - # Configure your Datadog site - DATADOG_JENKINS_PLUGIN_DATADOG_SITE=US1 - - # Configure your API key - DATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key - - # Enable CI Visibility - DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true - - # (Optional) Configure your CI Instance name - DATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins - - # (Optional) Enable logs collection - DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true - - # (Optional) Configure the name of the host that you use to access Datadog UI - DATADOG_JENKINS_PLUGIN_DATADOG_APP_HOSTNAME=app.datadoghq.com - {{< /code-block >}} - - {{% /site-region %}} - - {{% site-region region="eu" %}} - {{< code-block lang="bash" disable_copy="true" collapsible="true" >}} - # Select the Datadog Agent mode - DATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP - - # Configure your Datadog site - DATADOG_JENKINS_PLUGIN_DATADOG_SITE=EU1 - - # Configure your API key - DATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key - - # Enable CI Visibility - DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true - - # (Optional) Configure your CI Instance name - DATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins - - # (Optional) Enable logs collection - DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true - - # (Optional) Configure the name of the host that you use to access Datadog UI - DATADOG_JENKINS_PLUGIN_DATADOG_APP_HOSTNAME=app.datadoghq.eu - {{< /code-block >}} - - {{% /site-region %}} - {{% site-region region="gov" %}} - - {{< code-block lang="bash" disable_copy="true" collapsible="true" >}} - # Select the Datadog Agent mode - DATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP - - # Configure your Datadog site - DATADOG_JENKINS_PLUGIN_DATADOG_SITE=US1_FED - - # Configure your API key - DATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key - - # Enable CI Visibility - DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true - - # (Optional) Configure your CI Instance name - DATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins - - # (Optional) Enable logs collection - DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true - - # (Optional) Configure the name of the host that you use to access Datadog UI - DATADOG_JENKINS_PLUGIN_DATADOG_APP_HOSTNAME=app.ddog-gov.com - {{< /code-block >}} - - {{% /site-region %}} - {{% site-region region="us3" %}} - - {{< code-block lang="bash" disable_copy="true" collapsible="true" >}} - # Select the Datadog Agent mode - DATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP - - # Configure your Datadog site - DATADOG_JENKINS_PLUGIN_DATADOG_SITE=US3 - - # Configure your API key - DATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key - - # Enable CI Visibility - DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true - - # (Optional) Configure your CI Instance name - DATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins - - # (Optional) Enable logs collection - DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true - - # (Optional) Configure the name of the host that you use to access Datadog UI - DATADOG_JENKINS_PLUGIN_DATADOG_APP_HOSTNAME=app.us3.datadoghq.com - {{< /code-block >}} - - {{% /site-region %}} - {{% site-region region="us5" %}} - - {{< code-block lang="bash" disable_copy="true" collapsible="true" >}} - # Select the Datadog Agent mode - DATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP - - # Configure your Datadog site - DATADOG_JENKINS_PLUGIN_DATADOG_SITE=US5 - - # Configure your API key - DATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key - - # Enable CI Visibility - DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true - - # (Optional) Configure your CI Instance name - DATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins - - # (Optional) Enable logs collection - DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true - - # (Optional) Configure the name of the host that you use to access Datadog UI - DATADOG_JENKINS_PLUGIN_DATADOG_APP_HOSTNAME=app.us5.datadoghq.com - {{< /code-block >}} - - {{% /site-region %}} - {{% site-region region="ap1" %}} - - {{< code-block lang="bash" disable_copy="true" collapsible="true" >}} - # Select the Datadog Agent mode - DATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP - - # Configure your Datadog site - DATADOG_JENKINS_PLUGIN_DATADOG_SITE=AP1 - - # Configure your API key - DATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key - - # Enable CI Visibility - DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true - - # (Optional) Configure your CI Instance name - DATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins - - # (Optional) Enable logs collection - DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true - - # (Optional) Configure the name of the host that you use to access Datadog UI - DATADOG_JENKINS_PLUGIN_DATADOG_APP_HOSTNAME=app.ap1.datadoghq.com - {{< /code-block >}} - {{% /site-region %}} - - {{% site-region region="ap2" %}} +```bash +# Select the Datadog Agent mode +DATADOG_JENKINS_PLUGIN_REPORT_WITH=DSD - {{< code-block lang="bash" disable_copy="true" collapsible="true" >}} - # Select the Datadog Agent mode - DATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP +# Configure the Agent host +DATADOG_JENKINS_PLUGIN_TARGET_HOST=your-agent-host - # Configure your Datadog site - DATADOG_JENKINS_PLUGIN_DATADOG_SITE=AP2 +# Configure the Traces Collection port (default 8126) +DATADOG_JENKINS_PLUGIN_TARGET_TRACE_COLLECTION_PORT=8126 - # Configure your API key - DATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key +# Enable CI Visibility +DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true - # Enable CI Visibility - DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true +# (Optional) Configure your CI Instance name +DATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins - # (Optional) Configure your CI Instance name - DATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins +# (Optional) Configure Log Collection port as configured in your Datadog Agent +DATADOG_JENKINS_PLUGIN_TARGET_LOG_COLLECTION_PORT=10518 - # (Optional) Enable logs collection - DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true +# (Optional) Enable logs collection +DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true - # (Optional) Configure the name of the host that you use to access Datadog UI - DATADOG_JENKINS_PLUGIN_DATADOG_APP_HOSTNAME=app.ap2.datadoghq.com - {{< /code-block >}} - {{% /site-region %}} +# (Optional) Configure the name of the host that you use to access Datadog UI +DATADOG_JENKINS_PLUGIN_DATADOG_APP_HOSTNAME=app.datadoghq.com +``` 2. Restart your Jenkins instance. -{{% /tab %}} -{{% tab "Report through the Datadog Agent (recommended)" %}} + +#### Agentless (using an API key) 1. Set the following environment variables on your Jenkins instance machine: - ```bash - # Select the Datadog Agent mode - DATADOG_JENKINS_PLUGIN_REPORT_WITH=DSD +```bash +# Select the Datadog Agent mode +DATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP - # Configure the Agent host - DATADOG_JENKINS_PLUGIN_TARGET_HOST=your-agent-host +# Configure your Datadog site +DATADOG_JENKINS_PLUGIN_DATADOG_SITE={{< region-param key=jenkins_site_name >}} - # Configure the Traces Collection port (default 8126) - DATADOG_JENKINS_PLUGIN_TARGET_TRACE_COLLECTION_PORT=8126 +# Configure your API key +DATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key - # Enable CI Visibility - DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true +# Enable CI Visibility +DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true - # (Optional) Configure your CI Instance name - DATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins +# (Optional) Configure your CI Instance name +DATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins - # (Optional) Configure Log Collection port as configured in your Datadog Agent - DATADOG_JENKINS_PLUGIN_TARGET_LOG_COLLECTION_PORT=10518 +# (Optional) Enable logs collection +DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true - # (Optional) Enable logs collection - DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true - - # (Optional) Configure the name of the host that you use to access Datadog UI - DATADOG_JENKINS_PLUGIN_DATADOG_APP_HOSTNAME=app.datadoghq.com - ``` +# (Optional) Configure the name of the host that you use to access Datadog UI +DATADOG_JENKINS_PLUGIN_DATADOG_APP_HOSTNAME={{< region-param key=dd_full_site >}} +``` 2. Restart your Jenkins instance. -{{% /tab %}} -{{< /tabs >}} - ## Collect job logs Job logs collection can be enabled optionally when configuring the Jenkins plugin (see previous section). @@ -953,12 +438,13 @@ However, depending on the Jenkins version and the pipeline details, there may be In this case you can make the Git information available to the plugin by using the `.each {k,v -> env.setProperty(k, v)}` function after executing the `checkout` or `git` steps. For example: -{{< tabs >}} -{{% tab "Using Declarative Pipelines" %}} +#### Using Declarative Pipelines + If you're using a declarative pipeline to configure your pipeline, propagate Git information using a `script` block as follows: Using the `checkout` step: -{{< code-block lang="groovy" >}} + +```groovy pipeline { stages { stage('Checkout') { @@ -969,10 +455,11 @@ pipeline { ... } } -{{< /code-block >}} +``` Using the `git` step: -{{< code-block lang="groovy" >}} + +```groovy pipeline { stages { stage('Checkout') { @@ -983,34 +470,33 @@ pipeline { ... } } -{{< /code-block >}} +``` + +#### Using Scripted Pipelines -{{% /tab %}} -{{% tab "Using Scripted Pipelines" %}} If you're using a scripted pipeline to configure your pipeline, you can propagate the git information to environment variables directly. Using the `checkout` step: -{{< code-block lang="groovy" >}} + +```groovy node { stage('Checkout') { checkout(...).each {k,v -> env.setProperty(k,v)} } ... } -{{< /code-block >}} +``` Using the `git` step: -{{< code-block lang="groovy" >}} + +```groovy node { stage('Checkout') { git(...).each {k,v -> env.setProperty(k,v)} } ... } -{{< /code-block >}} - -{{% /tab %}} -{{< /tabs >}} +``` ### Set Git information manually From 4e995ffe3f4139d615b288b3dd2e71fe36738b6b Mon Sep 17 00:00:00 2001 From: hestonhoffman Date: Mon, 10 Nov 2025 11:56:25 -0800 Subject: [PATCH 2/4] Fix merge conflict --- assets/scripts/config/regions.config.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/assets/scripts/config/regions.config.js b/assets/scripts/config/regions.config.js index c1d6c30740383..8e13485d3ef72 100644 --- a/assets/scripts/config/regions.config.js +++ b/assets/scripts/config/regions.config.js @@ -542,8 +542,6 @@ export default { ap1: 'config.ap1.datadoghq.com', ap2: 'violet.intake.ap2.datadoghq.com', gov: 'config.ddog-gov.com' -<<<<<<< Updated upstream -======= }, org_management_max_session_duration: { us: '720 hours (30 days)', @@ -562,6 +560,5 @@ export default { ap1: 'AP1', ap2: 'AP2', gov: 'US1_FED' ->>>>>>> Stashed changes } }; From 553949fdf5d43c8055bd4f153474adf4e2e87df4 Mon Sep 17 00:00:00 2001 From: hestonhoffman Date: Mon, 10 Nov 2025 13:13:49 -0800 Subject: [PATCH 3/4] proxy_firewall_vpn --- assets/scripts/config/regions.config.js | 9 ++++ .../environments/proxy_firewall_vpn.md | 50 +++---------------- 2 files changed, 17 insertions(+), 42 deletions(-) diff --git a/assets/scripts/config/regions.config.js b/assets/scripts/config/regions.config.js index 8e13485d3ef72..aa107621f01b3 100644 --- a/assets/scripts/config/regions.config.js +++ b/assets/scripts/config/regions.config.js @@ -560,5 +560,14 @@ export default { ap1: 'AP1', ap2: 'AP2', gov: 'US1_FED' + }, + synthetics_tunnel_endpoint: { + us: 'tunnel-us1.synthetics.datadoghq.com', + us3: 'tunnel-us3.synthetics.datadoghq.com', + us5: 'tunnel-us5.synthetics.datadoghq.com', + eu: 'tunnel-eu1.synthetics.datadoghq.com', + ap1: 'tunnel-ap1.synthetics.datadoghq.com', + ap2: 'tunnel-ap2.synthetics.datadoghq.com', + gov: 'N/A' } }; diff --git a/content/en/continuous_testing/environments/proxy_firewall_vpn.md b/content/en/continuous_testing/environments/proxy_firewall_vpn.md index 50433a0c18d49..a9fdc6595cd69 100644 --- a/content/en/continuous_testing/environments/proxy_firewall_vpn.md +++ b/content/en/continuous_testing/environments/proxy_firewall_vpn.md @@ -53,56 +53,22 @@ Allow **Outbound connections** for the following Datadog endpoints: | Port | Endpoint | Description | | ---- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| 443 | `tunnel-us1.synthetics.datadoghq.com` | Required to open the WSS connection from the `datadog-ci` client to the tunnel service. | +| 443 | {{< region-param key="synthetics_tunnel_endpoint" code="true" >}} | Required to open the WSS connection from the `datadog-ci` client to the tunnel service. | | 443 | `intake.synthetics.datadoghq.com` | Required to get the presigned URL and to trigger the Synthetic tests. | -| 443 | `api.datadoghq.com` | Required to search for Synthetic tests, get them, and poll their results. | +| 443 | {{< region-param key="api_endpoint" code="true" >}} | Required to search for Synthetic tests, get them, and poll their results. | {{< /site-region >}} - -{{< site-region region="eu" >}} - -| Port | Endpoint | Description | -| ---- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| 443 | `tunnel-eu1.synthetics.datadoghq.com` | Required to open the WSS connection from the `datadog-ci` client to the tunnel service. | -| 443 | `api.datadoghq.eu` | Required to get the presigned URL, search for Synthetic tests, get them, trigger them, and poll their results. | - -**Note**: Although the tunnel service top level domain is `.com` (and not `.eu`), the endpoint is located in EU (Frankfurt AWS). - -{{< /site-region >}} - -{{< site-region region="us3" >}} - -| Port | Endpoint | Description | -| ---- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| 443 | `tunnel-us3.synthetics.datadoghq.com` | Required to open the WSS connection from the `datadog-ci` client to the tunnel service. | -| 443 | `api.us3.datadoghq.com` | Required to get the presigned URL, search for Synthetic tests, get them, trigger them, and poll their results. | - -{{< /site-region >}} - -{{< site-region region="us5" >}} +{{< site-region region="us3,us5,eu,ap1,ap2" >}} | Port | Endpoint | Description | | ---- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| 443 | `tunnel-us5.synthetics.datadoghq.com` | Required to open the WSS connection from the `datadog-ci` client to the tunnel service. | -| 443 | `api.us5.datadoghq.com` | Required to get the presigned URL, search for Synthetic tests, get them, trigger them, and poll their results. | +| 443 | {{< region-param key="synthetics_tunnel_endpoint" code="true" >}} | Required to open the WSS connection from the `datadog-ci` client to the tunnel service. | +| 443 | {{< region-param key="api_endpoint" code="true" >}} | Required to get the presigned URL, search for Synthetic tests, get them, trigger them, and poll their results. | {{< /site-region >}} +{{< site-region region="eu" >}} -{{< site-region region="ap1" >}} - - Port | Endpoint | Description | -| ---- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| 443 | `tunnel-ap1.synthetics.datadoghq.com` | Required to open the WSS connection from the `datadog-ci` client to the tunnel service. | -| 443 | `api.ap1.datadoghq.com` | Required to get the presigned URL, search for Synthetic tests, get them, trigger them, and poll their results. | - -{{< /site-region >}} - -{{< site-region region="ap2" >}} - - Port | Endpoint | Description | -| ---- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| 443 | `tunnel-ap2.synthetics.datadoghq.com` | Required to open the WSS connection from the `datadog-ci` client to the tunnel service. | -| 443 | `api.ap2.datadoghq.com` | Required to get the presigned URL, search for Synthetic tests, get them, trigger them, and poll their results. | +**Note**: Although the tunnel service top level domain is `.com` (and not `.eu`), the endpoint is located in EU (Frankfurt AWS). {{< /site-region >}} @@ -118,7 +84,7 @@ For `resourceUrlSubstitutionRegexes`, specify an array of strings, each containi For example: -``` +```text https://prod.my-app.com/assets/(.*)|http://localhost:3000/assets/$1 ``` From d95d773c5c1b7c3e8330161132b0cdf103eff12a Mon Sep 17 00:00:00 2001 From: hestonhoffman Date: Mon, 10 Nov 2025 13:39:17 -0800 Subject: [PATCH 4/4] Dev section --- assets/scripts/config/regions.config.js | 9 +++++++++ content/en/developers/guide/dogwrap.md | 22 +--------------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/assets/scripts/config/regions.config.js b/assets/scripts/config/regions.config.js index aa107621f01b3..d5f10282e8964 100644 --- a/assets/scripts/config/regions.config.js +++ b/assets/scripts/config/regions.config.js @@ -569,5 +569,14 @@ export default { ap1: 'tunnel-ap1.synthetics.datadoghq.com', ap2: 'tunnel-ap2.synthetics.datadoghq.com', gov: 'N/A' + }, + dogwrap_site_flag: { + us: '', + us3: ' -s us3', + us5: ' -s us5', + eu: ' -s eu', + ap1: '', + ap2: '', + gov: '' } }; diff --git a/content/en/developers/guide/dogwrap.md b/content/en/developers/guide/dogwrap.md index 230b00ab36fb1..c35c22bce5360 100644 --- a/content/en/developers/guide/dogwrap.md +++ b/content/en/developers/guide/dogwrap.md @@ -22,29 +22,9 @@ To install from source: The minimum valid `dogwrap` command has the following layout: -{{< site-region region="us,gov,ap1,ap2" >}} ```bash -dogwrap -n -k "" +dogwrap -n -k {{< region-param key=dogwrap_site_flag >}} "" ``` -{{< /site-region >}} - -{{< site-region region="us3" >}} -```bash -dogwrap -n -k -s us3 "" -``` -{{< /site-region >}} - -{{< site-region region="us5" >}} -```bash -dogwrap -n -k -s us5 "" -``` -{{< /site-region >}} - -{{< site-region region="eu" >}} -```bash -dogwrap -n -k -s eu "" -``` -{{< /site-region >}} **Note**: The `dogwrap` command sends data to the US Datadog site by default. If you need to send data to another site, you must include the `-s` option specifying a target site, such as `eu`, `us3`, `us5`, etc.