CI Visibility is not available in the selected site () at this time.

Overview

You can send custom pipelines through HTTP using the public API endpoint. For more information about how pipeline executions are modeled, see Pipeline Data Model and Execution Types.

Compatibility

Pipeline VisibilityPlatformDefinition
Custom tags and measures at runtimeCustom tags and measures at runtimeConfigure custom tags and measures at runtime.
Manual stepsManual stepsView manually triggered pipelines.
ParametersParametersSet custom parameters when a pipeline is triggered.
Partial retriesPartial pipelinesView partially retried pipeline executions.
Pipeline failure reasonsPipeline failure reasonsIdentify pipeline failure reasons from error messages.
Queue timeQueue timeView the amount of time pipeline jobs sit in the queue before processing.

Configure CI Visibility

To send pipeline events programmatically to Datadog, ensure that your DD_API_KEY is configured.

  1. Set the headers of your HTTP request:

  2. Prepare the payload body by entering information about the pipeline execution in a cURL command:

    Parameter NameDescriptionExample Value
    Unique IDThe UUID of the pipeline run. The ID has to be unique across retries and pipelines, including partial retries.b3262537-a573-44eb-b777-4c0f37912b05
    NameThe name of the pipeline. All pipeline runs for the builds should have the same name.Documentation Build
    Git RepositoryThe Git repository URL that triggered the pipeline.https://github.com/Datadog/documentation
    Commit AuthorThe commit author email that triggered the pipeline.contributor@github.com
    Commit SHAThe commit hash that triggered the pipeline.cf852e17dea14008ac83036430843a1c
    StatusThe final status of the pipeline. Allowed enum values: success, error, canceled, skipped, blocked, or running.success
    Partial RetryWhether or not the pipeline was a partial retry of a previous attempt. This field expects a boolean value (true or false). A partial retry is one which only runs a subset of the original jobs.false
    StartTime when the pipeline run started (it should not include any queue time). The time format must be RFC3339.2024-08-22T11:36:29-07:00
    EndTime when the pipeline run finished. The time format must be RFC3339.2024-08-22T14:36:00-07:00
    URLThe URL to look at the pipeline in the CI provider UI.http://your-ci-provider.com/pipeline/{pipeline-id}

    For example, this payload sends a CI pipeline event to Datadog:

       curl -X POST "https://api.datadoghq.com/api/v2/ci/pipeline" \
       -H "Content-Type: application/json" \
       -H "DD-API-KEY: <YOUR_API_KEY>" \
       -d @- << EOF
       {
         "data": {
           "attributes": {
             "resource": {
               "level": "pipeline",
               "unique_id": "b3262537-a573-44eb-b777-4c0f37912b05",
               "name": "Documentation Build",
               "git": {
                 "repository_url": "https://github.com/Datadog/documentation",
                 "author_email": "contributor@github.com",
                 "sha": "cf852e17dea14008ac83036430843a1c"
               },
               "status": "success",
               "start": "2024-08-22T11:36:29-07:00",
               "end": "2024-08-22T14:36:00-07:00",
               "partial_retry": false,
               "url": ""
             }
           },
           "type": "cipipeline_resource_request"
         }
       }
       EOF
       
  3. After sending your pipeline event to Datadog, you can integrate additional event types such as stage, job, and step. For more information, see the Send Pipeline Event endpoint.

Visualize pipeline data in Datadog

The CI Pipeline List and Executions pages populate with data after the pipelines are accepted for processing.

The CI Pipeline List page shows data for only the default branch of each repository. For more information, see Search and Manage CI Pipelines.

Further reading

PREVIEWING: may/unit-testing