Sending Events and Logs to Datadog with Amazon EventBridge API Destinations

Amazon EventBridge is a serverless event bus that enables you to build event-driven applications. EventBridge can integrate with your AWS services, but the API destinations feature lets you push and pull data from outside of AWS using APIs. This guide gives steps for sending your events and logs from EventBridge to Datadog. For more information about pushing your events from Datadog to EventBridge, see the EventBridge integration docs.

Setup

Before you begin, you need a Datadog account, with an API key, and you need access to Amazon Eventbridge API destinations.

Configuration

  1. Follow the steps in the Amazon Create an API destination docs to add Datadog as an API destination.

    • Use API key authorization, with DD-API-KEY as your key name and your Datadog API key as the value.
    • For your destination endpoint, use https://http-intake.logs.datadoghq.com/v1/input for logs or https://api.datadoghq.com/api/v1/events for events, and set POST as the HTTP method. For more information about the differences between logs and events, see the logs section, and the events section of the Categories of Data docs page.
    • If you are utilizing the events endpoint, you need to include a title and text as body.field parameters in the API Destination connection. These are required values to POST to the events endpoint. For more information, see the Post an event documentation.
  2. Once you have set up the destination, see the Amazon documentation to create an EventBridge rule, where you set Datadog as your destination.

  3. Once you have set up the rule with Datadog as the destination, trigger an event by posting an event to EventBridge. For more information about pushing events to EventBridge from Datadog, see the EventBridge integration documentation. For example, to trigger a test event by uploading the objects to an S3 bucket in your account, use this AWS CloudShell command:

    echo "test" > testfile.txt
    aws s3 cp testfile.txt s3://YOUR_BUCKET_NAME
    
  4. Once events and logs are sending, after about five minutes, the data is available in the Datadog Logs Console or Events Explorer, depending on which endpoint you are sending them to.

Troubleshooting

To see more details about the payloads sent to Datadog and to view the response of the API endpoints, set up an Amazon SQS queue:

  1. Create a queue in Amazon SQS.
  2. Go to the EventBridge rule that you created in the Configuration section.
  3. Select the Targets tab and click Edit.
  4. Expand the Additional settings section.
  5. In the Dead-letter queue section, choose Select an Amazon SQS queue in the current AWS account to use as the dead-letter queue.
  6. Select the SQS queue that you just created.
  7. Update the rule.

Further Reading

Additional helpful documentation, links, and articles: