Datadog

Show Datadog telemetry in context on any page

Create an Integration Configuration

To configure the Datadog integration, you'll need to provide the following:

Example: Define a Custom AI Copilot Tool to Search Logs

The Datadog integration can be used to define a custom copilot tool to search logs using the Search Logs (POST) endpoint.

For more information on defining custom copilots, prompts, and tools see AI Copilot

Step 1: Configure an AI Copilot Tool Brick

  • Name: search_datadog_error_logs

  • Description: Search error logs from Datadog for a user by email from the past hour

For the parameters, provide the following schema:

{
  type: "object",
  properties: {
    email: {
      type: "string",
      format: "email",
      description: "The user's email address"
    },
  },
  required: ["email"],
}

Step 2: Configure the Search Payload

In the Brick Outline, add the Run JavaScript brick to the tool's event handler

  • Add an email argument with value @args.value

  • Provide the following body:

To customize the query, refer to the Search Logs (POST) endpoint documentation

function (args) {
  const { email } = args;  
  return {
    "filter": {
        "query": `@usr.email:${email}`,
        "from": "now-1h"
    }
  }
}

Step 3: Configure the Request

In the Brick Outline, add the HTTP Request brick

  • URL: /api/v2/logs/events/search

  • Integration Configuration: select your integration configuration

  • Data: provide the output of the Search Payload

Resources

Last updated

Was this helpful?