CI Visibility is not available in the selected site () at this time.
Overview
Jenkins is an automation server with continuous integration and delivery features. With its plugin architecture, Jenkins can be customized to fit any CI/CD need and automates all aspects of project development, testing, and deployment.
Set up tracing in Jenkins to collect data across various stages of your pipeline executions, identify performance bottlenecks, resolve operational challenges, and refine your deployment processes.
Identify pipeline failure reasons from error messages.
The following Jenkins versions are supported:
Jenkins >= 2.346.1
This integration supports both Agentless and Agent-based installation. For infrastructure metric correlation, installing with the Agent-based mode is recommended.
Create or modify the configuration YAML by adding an entry for datadogGlobalConfiguration:
unclassified:datadogGlobalConfiguration:# Select the `Agentless` mode (HTTP).reportWith:"HTTP"# Update the endpoints if reporting to Datadog sites other that `datadoghq.com`targetApiURL:"https://api.datadoghq.com/api/"targetLogIntakeURL:"https://http-intake.logs.datadoghq.com/v1/input/"targetWebhookIntakeURL:"https://webhook-intake.datadoghq.com/api/v2/webhook/"# Configure your API keytargetCredentialsApiKey:"<your-api-key>"# (Optional) Configure your CI Instance nameciInstanceName:"jenkins"
unclassified:datadogGlobalConfiguration:# Select the `Agentless` mode (HTTP).reportWith:"HTTP"# Update the endpoints if reporting to Datadog sites other that `datadoghq.com`targetApiURL:"https://api.datadoghq.eu/api/"targetLogIntakeURL:"https://http-intake.logs.datadoghq.eu/v1/input/"targetWebhookIntakeURL:"https://webhook-intake.datadoghq.eu/api/v2/webhook/"# Configure your API keytargetCredentialsApiKey:"<your-api-key>"# (Optional) Configure your CI Instance nameciInstanceName:"jenkins"
unclassified:datadogGlobalConfiguration:# Select the `Agentless` mode (HTTP).reportWith:"HTTP"# Update the endpoints if reporting to Datadog sites other that `datadoghq.com`targetApiURL:"https://api.dd-gov.com/api/"targetLogIntakeURL:"https://http-intake.logs.dd-gov.com/v1/input/"targetWebhookIntakeURL:"https://webhook-intake.dd-gov.com/api/v2/webhook/"# Configure your API keytargetCredentialsApiKey:"<your-api-key>"# (Optional) Configure your CI Instance nameciInstanceName:"jenkins"
unclassified:datadogGlobalConfiguration:# Select the `Agentless` mode (HTTP).reportWith:"HTTP"# Update the endpoints if reporting to Datadog sites other that `datadoghq.com`targetApiURL:"https://api.us3.datadoghq.com/api/"targetLogIntakeURL:"https://http-intake.logs.us3.datadoghq.com/v1/input/"targetWebhookIntakeURL:"https://webhook-intake.us3.datadoghq.com/api/v2/webhook/"# Configure your API keytargetCredentialsApiKey:"<your-api-key>"# (Optional) Configure your CI Instance nameciInstanceName:"jenkins"
unclassified:datadogGlobalConfiguration:# Select the `Agentless` mode (HTTP).reportWith:"HTTP"# Update the endpoints if reporting to Datadog sites other that `datadoghq.com`targetApiURL:"https://api.us5.datadoghq.com/api/"targetLogIntakeURL:"https://http-intake.logs.us5.datadoghq.com/v1/input/"targetWebhookIntakeURL:"https://webhook-intake.us5.datadoghq.com/api/v2/webhook/"# Configure your API keytargetCredentialsApiKey:"<your-api-key>"# (Optional) Configure your CI Instance nameciInstanceName:"jenkins"
unclassified:datadogGlobalConfiguration:# Select the `Agentless` mode (HTTP).reportWith:"HTTP"# Update the endpoints if reporting to Datadog sites other that `datadoghq.com`targetApiURL:"https://api.ap1.datadoghq.com/api/"targetLogIntakeURL:"https://http-intake.logs.ap1.datadoghq.com/v1/input/"targetWebhookIntakeURL:"https://webhook-intake.ap1.datadoghq.com/api/v2/webhook/"# Configure your API keytargetCredentialsApiKey:"<your-api-key>"# (Optional) Configure your CI Instance nameciInstanceName:"jenkins"
In your Jenkins instance web interface, go to Manage Jenkins > Configuration as Code.
Apply or reload the configuration.
Check the configuration using the View Configuration button.
Create or modify the configuration YAML by adding an entry for datadogGlobalConfiguration:
unclassified:datadogGlobalConfiguration:# Select the `Datadog Agent` mode (DSD).reportWith:"DSD"# Configure the `Agent` hosttargetHost:"<your-agent-host>"# Configure the `Traces Collection` porttargetTraceCollectionPort:8126# Enable CI Visibility flagenableCiVisibility:true# (Optional) Configure your CI Instance nameciInstanceName:"jenkins"
In your Jenkins instance web interface, go to Manage Jenkins > Configuration as Code.
Apply or reload the configuration.
Check the configuration using the View Configuration button.
Configure with Groovy
In your Jenkins instance web interface, go to Manage Jenkins > Script Console.
Run the configuration script:
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Select the Datadog Agent mode
d.setReportWith('HTTP')// Endpoint URLs correspond to your Datadog site
d.setTargetApiURL("https://api.datadoghq.com/api/")d.setTargetLogIntakeURL("https://http-intake.logs.datadoghq.com/v1/input/")d.setTargetWebhookIntakeURL("https://webhook-intake.datadoghq.com/api/v2/webhook/")// Configure your API key
d.setTargetApiKey("your-api-key")// Enable CI Visibility
d.setEnableCiVisibility(true)// (Optional) Configure your CI Instance name
d.setCiInstanceName("jenkins")// Save config
d.save()
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Select the Datadog Agent mode
d.setReportWith('HTTP')// Endpoint URLs correspond to your Datadog site
d.setTargetApiURL("https://api.ap1.datadoghq.eu/api/")d.setTargetLogIntakeURL("https://http-intake.logs.ap1.datadoghq.eu/v1/input/")d.setTargetWebhookIntakeURL("https://webhook-intake.ap1.datadoghq.eu/api/v2/webhook/")// Configure your API key
d.setTargetApiKey("your-api-key")// Enable CI Visibility
d.setEnableCiVisibility(true)// (Optional) Configure your CI Instance name
d.setCiInstanceName("jenkins")// Save config
d.save()
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Select the Datadog Agent mode
d.setReportWith('HTTP')// Endpoint URLs correspond to your Datadog site
d.setTargetApiURL("https://api.dd-gov.com/api/")d.setTargetLogIntakeURL("https://http-intake.logs.dd-gov.com/v1/input/")d.setTargetWebhookIntakeURL("https://webhook-intake.dd-gov.com/api/v2/webhook/")// Configure your API key
d.setTargetApiKey("your-api-key")// Enable CI Visibility
d.setEnableCiVisibility(true)// (Optional) Configure your CI Instance name
d.setCiInstanceName("jenkins")// Save config
d.save()
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Select the Datadog Agent mode
d.setReportWith('HTTP')// Endpoint URLs correspond to your Datadog site
d.setTargetApiURL("https://api.us3.datadoghq.com/api/")d.setTargetLogIntakeURL("https://http-intake.logs.us3.datadoghq.com/v1/input/")d.setTargetWebhookIntakeURL("https://webhook-intake.us3.datadoghq.com/api/v2/webhook/")// Configure your API key
d.setTargetApiKey("your-api-key")// Enable CI Visibility
d.setEnableCiVisibility(true)// (Optional) Configure your CI Instance name
d.setCiInstanceName("jenkins")// Save config
d.save()
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Select the Datadog Agent mode
d.setReportWith('HTTP')// Endpoint URLs correspond to your Datadog site
d.setTargetApiURL("https://api.us5.datadoghq.com/api/")d.setTargetLogIntakeURL("https://http-intake.logs.us5.datadoghq.com/v1/input/")d.setTargetWebhookIntakeURL("https://webhook-intake.us5.datadoghq.com/api/v2/webhook/")// Configure your API key
d.setTargetApiKey("your-api-key")// Enable CI Visibility
d.setEnableCiVisibility(true)// (Optional) Configure your CI Instance name
d.setCiInstanceName("jenkins")// Save config
d.save()
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Select the Datadog Agent mode
d.setReportWith('HTTP')// Endpoint URLs correspond to your Datadog site
d.setTargetApiURL("https://api.ap1.datadoghq.com/api/")d.setTargetLogIntakeURL("https://http-intake.logs.ap1.datadoghq.com/v1/input/")d.setTargetWebhookIntakeURL("https://webhook-intake.ap1.datadoghq.com/api/v2/webhook/")// Configure your API key
d.setTargetApiKey("your-api-key")// Enable CI Visibility
d.setEnableCiVisibility(true)// (Optional) Configure your CI Instance name
d.setCiInstanceName("jenkins")// Save config
d.save()
In your Jenkins instance web interface, go to Manage Jenkins > Script Console.
Run the configuration script:
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Select the Datadog Agent mode
d.setReportWith('DSD')// Configure the Agent host.
d.setTargetHost('<your-agent-host>')// Configure the Traces Collection port (default 8126)
d.setTargetTraceCollectionPort(8126)// Enable CI Visibility
d.setEnableCiVisibility(true)// (Optional) Configure your CI Instance name
d.setCiInstanceName("jenkins")// Save config
d.save()
Use environment variables
Set the following environment variables on your Jenkins instance machine:
# Select the Datadog Agent modeDATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP
# Endpoint URLs correspond to your Datadog siteDATADOG_JENKINS_PLUGIN_TARGET_API_URL="https://api.datadoghq.com/api/"DATADOG_JENKINS_PLUGIN_TARGET_LOG_INTAKE_URL="https://http-intake.logs.datadoghq.com/v1/input/"DATADOG_JENKINS_TARGET_WEBHOOK_INTAKE_URL="https://webhook-intake.datadoghq.com/api/v2/webhook/"# Configure your API keyDATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key
# Enable CI VisibilityDATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true# (Optional) Configure your CI Instance nameDATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins
# Select the Datadog Agent modeDATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP
# Endpoint URLs correspond to your Datadog siteDATADOG_JENKINS_PLUGIN_TARGET_API_URL="https://api.datadoghq.eu/api/"DATADOG_JENKINS_PLUGIN_TARGET_LOG_INTAKE_URL="https://http-intake.logs.datadoghq.eu/v1/input/"DATADOG_JENKINS_TARGET_WEBHOOK_INTAKE_URL="https://webhook-intake.datadoghq.eu/api/v2/webhook/"# Configure your API keyDATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key
# Enable CI VisibilityDATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true# (Optional) Configure your CI Instance nameDATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins
# Select the Datadog Agent modeDATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP
# Endpoint URLs correspond to your Datadog siteDATADOG_JENKINS_PLUGIN_TARGET_API_URL="https://api.dd-gov.com/api/"DATADOG_JENKINS_PLUGIN_TARGET_LOG_INTAKE_URL="https://http-intake.logs.dd-gov.com/v1/input/"DATADOG_JENKINS_TARGET_WEBHOOK_INTAKE_URL="https://webhook-intake.dd-gov.com/api/v2/webhook/"# Configure your API keyDATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key
# Enable CI VisibilityDATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true# (Optional) Configure your CI Instance nameDATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins
# Select the Datadog Agent modeDATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP
# Endpoint URLs correspond to your Datadog siteDATADOG_JENKINS_PLUGIN_TARGET_API_URL="https://api.us3.datadoghq.com/api/"DATADOG_JENKINS_PLUGIN_TARGET_LOG_INTAKE_URL="https://http-intake.logs.us3.datadoghq.com/v1/input/"DATADOG_JENKINS_TARGET_WEBHOOK_INTAKE_URL="https://webhook-intake.us3.datadoghq.com/api/v2/webhook/"# Configure your API keyDATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key
# Enable CI VisibilityDATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true# (Optional) Configure your CI Instance nameDATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins
# Select the Datadog Agent modeDATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP
# Endpoint URLs correspond to your Datadog siteDATADOG_JENKINS_PLUGIN_TARGET_API_URL="https://api.us5.datadoghq.com/api/"DATADOG_JENKINS_PLUGIN_TARGET_LOG_INTAKE_URL="https://http-intake.logs.us5.datadoghq.com/v1/input/"DATADOG_JENKINS_TARGET_WEBHOOK_INTAKE_URL="https://webhook-intake.us5.datadoghq.com/api/v2/webhook/"# Configure your API keyDATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key
# Enable CI VisibilityDATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true# (Optional) Configure your CI Instance nameDATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins
# Select the Datadog Agent modeDATADOG_JENKINS_PLUGIN_REPORT_WITH=HTTP
# Endpoint URLs correspond to your Datadog siteDATADOG_JENKINS_PLUGIN_TARGET_API_URL="https://api.ap1.datadoghq.com/api/"DATADOG_JENKINS_PLUGIN_TARGET_LOG_INTAKE_URL="https://http-intake.logs.ap1.datadoghq.com/v1/input/"DATADOG_JENKINS_TARGET_WEBHOOK_INTAKE_URL="https://webhook-intake.ap1.datadoghq.com/api/v2/webhook/"# Configure your API keyDATADOG_JENKINS_PLUGIN_TARGET_API_KEY=your-api-key
# Enable CI VisibilityDATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true# (Optional) Configure your CI Instance nameDATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins
Restart your Jenkins instance.
Set the following environment variables on your Jenkins instance machine:
# Select the Datadog Agent modeDATADOG_JENKINS_PLUGIN_REPORT_WITH=DSD
# Configure the Agent hostDATADOG_JENKINS_PLUGIN_TARGET_HOST=your-agent-host
# Configure the Traces Collection port (default 8126)DATADOG_JENKINS_PLUGIN_TARGET_TRACE_COLLECTION_PORT=8126# Enable CI VisibilityDATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY=true# (Optional) Configure your CI Instance nameDATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME=jenkins
Restart your Jenkins instance.
Validate the configuration
To verify that CI Visibility is enabled, go to Jenkins Log and search for:
The Datadog Jenkins plugin can either report metrics through the Datadog Agent or directly to Datadog if an API key is provided. If you don’t have a Datadog Agent running on the Jenkins controller instance, Datadog recommends installing it first by following the Agent installation instructions. Whether you choose to use Agentless mode or the Agent-based mode, you are required to use the plugin.
If the Jenkins controller and the Datadog Agent have been deployed to a Kubernetes cluster, Datadog recommends using the Admission Controller, which automatically sets the DD_AGENT_HOST environment variable in the Jenkins controller pod to communicate with the local Datadog Agent.
Note: Sending CI Visibility traces through UNIX domain sockets is not supported.
Add logs_enabled: true to your Agent’s datadog.yaml configuration file, or set the DD_LOGS_ENABLED environment variable to true.
Create a file at %ProgramData%\Datadog\conf.d\jenkins.d\conf.yaml with the following. Ensure the service matches the CI instance name provided earlier.
Add logs_enabled: true to your Agent’s datadog.yaml configuration file, or set the DD_LOGS_ENABLED environment variable to true.
Create a file at ~/.datadog-agent/conf.d/jenkins.d/conf.yaml with the following contents. Ensure the service matches the CI instance name provided earlier.
Note: Logs are billed separately from CI Visibility. Log retention, exclusion, and indexes are configured in Logs Settings. Logs for Jenkins jobs can be identified by the source:jenkins tag.
unclassified:datadogGlobalConfiguration:# Configure the `Log Collection` port, as configured in the Datadog Agent,targetLogCollectionPort:10518# Enable Log collectioncollectBuildLogs:true
Jenkins インスタンスの Web インターフェースで、Manage Jenkins > Configuration as Code にアクセスします。
コンフィギュレーションを適用または再ロードします。
View Configuration ボタンを使用してコンフィギュレーションを確認します。
Groovy で有効にする
Jenkins インスタンスの Web インターフェースで、Manage Jenkins > Script Console にアクセスします。
構成スクリプトを、以下を含めるように更新します。
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Endpoint URLs correspond to your Datadog site
d.setTargetLogIntakeURL("https://http-intake.logs.datadoghq.com/v1/input/")// Enable log collection
d.setCollectBuildLogs(true)// Save config
d.save()
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Endpoint URLs correspond to your Datadog site
d.setTargetLogIntakeURL("https://http-intake.logs.datadoghq.eu/v1/input/")// Enable log collection
d.setCollectBuildLogs(true)// Save config
d.save()
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Endpoint URLs correspond to your Datadog site
d.setTargetLogIntakeURL("https://http-intake.logs.us3.datadoghq.com/v1/input/")// Enable log collection
d.setCollectBuildLogs(true)// Save config
d.save()
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Endpoint URLs correspond to your Datadog site
d.setTargetLogIntakeURL("https://http-intake.logs.us5.datadoghq.com/v1/input/")// Enable log collection
d.setCollectBuildLogs(true)// Save config
d.save()
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Endpoint URLs correspond to your Datadog site
d.setTargetLogIntakeURL("https://http-intake.logs.dd-gov.com/v1/input/")// Enable log collection
d.setCollectBuildLogs(true)// Save config
d.save()
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Endpoint URLs correspond to your Datadog site
d.setTargetLogIntakeURL("https://http-intake.logs.ap1.datadoghq.com/v1/input/")// Enable log collection
d.setCollectBuildLogs(true)// Save config
d.save()
Jenkins インスタンスの Web インターフェースで、Manage Jenkins > Script Console にアクセスします。
構成スクリプトを、以下を含めるように更新します。
importjenkins.model.*importorg.datadog.jenkins.plugins.datadog.DatadogGlobalConfigurationdefj=Jenkins.getInstance()defd=j.getDescriptor("org.datadog.jenkins.plugins.datadog.DatadogGlobalConfiguration")// Configure the Log Collection port, as configured in the Datadog Agent.
d.setTargetLogCollectionPort(10518)// Enable log collection
d.setCollectBuildLogs(true)// Save config
d.save()
環境変数を使う
Jenkins インスタンスマシンで次の環境変数を追加します。
# Endpoint URLs correspond to your Datadog siteDATADOG_JENKINS_PLUGIN_TARGET_LOG_INTAKE_URL="https://http-intake.logs.datadoghq.com/v1/input/"# ログ収集の有効化DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true
# Endpoint URLs correspond to your Datadog siteDATADOG_JENKINS_PLUGIN_TARGET_LOG_INTAKE_URL="https://http-intake.logs.datadoghq.eu/v1/input/"# ログ収集の有効化DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true
# Endpoint URLs correspond to your Datadog siteDATADOG_JENKINS_PLUGIN_TARGET_LOG_INTAKE_URL="https://http-intake.logs.us3.datadoghq.com/v1/input/"# ログ収集の有効化DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true
# Endpoint URLs correspond to your Datadog siteDATADOG_JENKINS_PLUGIN_TARGET_LOG_INTAKE_URL="https://http-intake.logs.us5.datadoghq.com/v1/input/"# ログ収集の有効化DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true
# Endpoint URLs correspond to your Datadog siteDATADOG_JENKINS_PLUGIN_TARGET_LOG_INTAKE_URL="https://http-intake.logs.dd-gov.com/v1/input/"# ログ収集の有効化DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true
# Endpoint URLs correspond to your Datadog siteDATADOG_JENKINS_PLUGIN_TARGET_LOG_INTAKE_URL="https://http-intake.logs.ap1.datadoghq.com/v1/input/"# ログ収集の有効化DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true
Jenkins インスタンスを再起動します。
Jenkins インスタンスマシンで次の環境変数を追加します。
# Configure the Log Collection port, as configured in the previous step.DATADOG_JENKINS_PLUGIN_TARGET_LOG_COLLECTION_PORT=10518# Enable log collectionDATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS=true
Jenkins インスタンスを再起動します。
Enable Test Visibility
This is an optional step that enables the collection of tests data using Test Visibility.
See the Test Visibility documentation for your language to make sure that the testing framework that you use is supported.
There are different ways to enable Test Visibility inside a Jenkins job or pipeline:
Using the Jenkins configuration UI.
Adding the datadog step inside the pipeline script.
Configuring the tracer manually.
For pipelines that spin up a Docker container to execute tests, you can only configure the tracer manually.
Jenkins の構成 UI で有効にする
UI-based Test Visibility configuration is available in Datadog Jenkins plugin v5.6.0 or later.
This option is not suitable for pipelines that are configured entirely in Jenkinsfile (for example, Multibranch pipelines or pipelines from Organization Folder).
For these pipelines use declarative configuration with the datadog step (described in the next section).
To enable Test Visibility via UI do the following:
In your Jenkins instance web interface, go to the job or pipeline that you want to instrument and choose the Configure option.
In the General configuration section, tick the Enable Datadog Test Visibility checkbox.
Enter the name of the service or library being tested into the Service Name input. You can choose any value that makes sense to you.
Choose the languages for which you want to enable tests instrumentation. Some of the languages do not support configuration through the UI. To configure Test Visibility for these languages, follow the manual configuration instructions.
pipeline{agentanyoptions{datadog(testVisibility:[enabled:true,serviceName:"my-service",// the name of service or library being tested
languages:["JAVA"],// languages that should be instrumented (available options are "JAVA", "JAVASCRIPT", "PYTHON", "DOTNET")
additionalVariables:["my-var":"value"]// additional tracer configuration settings (optional)
])}stages{stage('Example'){steps{echo"Hello world."}}}}
In a scripted pipeline, wrap the relevant section with the datadog step like so:
Some features of the Datadog Jenkins plugin need Git information associated with the Jenkins builds to work correctly.
The minimum required Git info for a build is repository URL, branch, commit SHA, and commit author email.
This information can be determined by the plugin automatically, propagated from SCM, provided manually with environment variables, or obtained by combining these approaches.
Propagate Git information from SCM
The Jenkins plugin is capable of automatically detecting Git information associated with a build or a pipeline.
However, depending on the Jenkins version and the pipeline details, there may be cases when automatic Git data detection is not possible.
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:
In case the plugin cannot detect Git information automatically and propagating Git data via SCM is not an option,
the necessary Git information can be set manually.
To do so, set the following environment variables.
To display and filter the teams associated with your pipelines, add team:<your-team> as a custom tag. The custom tag name must match your Datadog Teams team handle exactly.
Lists of included and excluded jobs can contain regular expressions, but not glob patterns. To include a job with a specific prefix, use prefix-.*—not prefix-*.
Datadog でパイプラインデータを視覚化する
Once the integration is successfully configured, both the CI Pipeline List and Executions pages populate with data after pipelines finish.
The CI Pipeline List page shows data for only the default branch of each repository.