이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.

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

Compatibility

  • Partial pipelines: View partially retried executions
  • Running pipelines: View pipeline executions that are running
    • Note: AWS CodePipeline running pipelines don’t have Git information until they have finished.

Configure the Datadog integration

To set up the integration between AWS CodePipeline and Datadog CI Visibility, create two AWS resources:

  1. API Destination: an HTTP endpoint pointing to Datadog’s intake.
  2. AWS EventBridge Rule: a rule that forwards CodePipeline events to the API Destination.

You can create these resources separately, or at the same time, during the EventBridge Rule creation process. For more information about monitoring pipeline events, see the official AWS guide.

Create the API Destination

  1. In the AWS Console, go to EventBridge > API destinations and click Create API destination.
  2. Choose a name for the API Destination (for example, datadog-ci-visibility-api) and optionally add a description.
  3. Under API destination endpoint, input https://webhook-intake./api/v2/webhook.
  4. Under HTTP method, select POST.
  5. Under Connection type, select Create a new connection:
    1. Choose a name for the connection (for example, datadog-ci-visibility-connection) and optionally add a description.
    2. Under Destination type, select Other.
    3. Under Authorization type, select API key. Input DD-API-KEY as the API key name and input your Datadog API Key in the Value field.
  6. Click Create.

Create the EventBridge Rule

  1. In the AWS Console, go to EventBridge > Rules and click Create Rule.
  2. Choose a name for the rule (for example, datadog-ci-visibility-integration) and optionally add a description.
  3. Leave the event bus as default, and, under Rule Type, select Rule with an event pattern. Click Next.
  4. Under Event Source, select AWS events or EventBridge partner events.
  5. Under Creation Method, select Custom pattern (JSON editor). Then, under Event Pattern, input the following JSON:
    {
      "source": ["aws.codepipeline"],
      "detail-type": ["CodePipeline Pipeline Execution State Change", "CodePipeline Action Execution State Change", "CodePipeline Stage Execution State Change"]
    }
    
    The JSON above sets up the integration for all of your pipelines. To restrict the set of pipelines, follow the Only monitor specific pipelines section below.
  6. Click Next.
  7. Under Target Types, select EventBridge API destination. Then, choose Use an existing API Destination and select the API destination that you have created in the previous step. Alternatively, you can also create the API destination by following the steps outlined in the Create the API Destination section.
  8. Under Headers Parameters, click Add header parameter. Input DD-CI-PROVIDER-AWSCODEPIPELINE as the key and true as the value.
  9. Choose Create a new role for this specific resource (or use an existing one).
  10. Review that the information is correct and create the rule.

Once the rule is created, the integration is complete, and you can monitor your pipelines in Datadog.

Only monitor specific pipelines

You can optionally restrict the pipelines that are monitored by Pipeline Visibility. To do this, add the detail.pipeline filter in the rule event pattern defined when creating the EventBridge Rule. For example:

 {
   "source": ["aws.codepipeline"],
   "detail-type": ["CodePipeline Pipeline Execution State Change", "CodePipeline Action Execution State Change", "CodePipeline Stage Execution State Change"],
   "detail": {
     "pipeline": ["first-pipeline", "second-pipeline"]
   }
 }

The event pattern above sets up the integration only for the first-pipeline and second-pipeline pipelines.

Correlate pipelines with tests

If you are using Test Visibility and your pipeline contains one or more AWS CodeBuild actions to execute tests, you can correlate your tests with the related pipeline inside Datadog Pipeline Visibility.

  1. In the AWS Console, go to your pipeline configuration and click Edit
  2. Go to the stage containing the AWS CodeBuild action, click Edit Stage, and then edit the relevant action.
  3. Under Environment variables, add an environment variable. Name the variable DD_PIPELINE_EXECUTION_ID, and the value #{codepipeline.PipelineExecutionId}. Leave the type as Plaintext.
  4. Click Done to save your changes.

The steps above allow you to add the pipeline execution ID to your CodeBuild action environment variables. For more information on working with variables, see the official AWS guide.

Visualize pipeline data in Datadog

View your data on the Pipelines and Pipeline Executions pages after the pipelines finish.

Note: The Pipelines page only shows data for the default branch of each repository.

Further reading