Datadog MCP Server

Integrations

  • Enables log search, trace span search, and trace span aggregation functionalities through the Datadog API, allowing users to retrieve and analyze logs and distributed trace data with flexible query and aggregation options.

Datadog MCP 服务器

英语(本文档) |日本语

Datadog API 的 MCP 服务器,支持日志搜索、跟踪跨度搜索和跟踪跨度聚合功能。

特征

  • 日志搜索:使用灵活的查询选项从 Datadog 搜索和检索日志
  • 跟踪跨度搜索:使用各种过滤选项搜索分布式跟踪跨度
  • 轨迹跨度聚合:按不同维度聚合轨迹跨度进行分析

工具

  1. search_logs
    • 在 Datadog 中搜索日志
    • 输入:
      • filterQuery (可选字符串):用于搜索日志的查询字符串(默认值:“*”)
      • filterFrom (可选数字):搜索开始时间以 UNIX 时间戳(以秒为单位)(默认值:15 分钟前)
      • filterTo (可选数字):搜索结束时间为 UNIX 时间戳(以秒为单位)(默认值:当前时间)
      • pageLimit (可选数字):要检索的最大日志数量(默认值:25,最大值:1000)
      • pageCursor (可选字符串):用于检索其他结果的分页游标
    • 返回:格式化文本,包含以下内容:
      • 搜索条件(查询条件和时间范围)
      • 找到的日志数量
      • 下一页光标(如果有)
      • 日志详细信息包括:
        • 服务名称
        • 标签
        • 时间戳
        • 地位
        • 留言(截断至 300 个字符)
        • 主持人
        • 重要属性(http.method、http.url、http.status_code、error)
  2. search_spans
    • 在 Datadog 中搜索跟踪跨度
    • 输入:
      • filterQuery (可选字符串):用于搜索跨度的查询字符串(默认值:“*”)
      • filterFrom (可选数字):搜索开始时间以 UNIX 时间戳(以秒为单位)(默认值:15 分钟前)
      • filterTo (可选数字):搜索结束时间为 UNIX 时间戳(以秒为单位)(默认值:当前时间)
      • pageLimit (可选数字):要检索的最大跨度数(默认值:25,最大值:1000)
      • pageCursor (可选字符串):用于检索其他结果的分页游标
    • 返回:格式化文本,包含以下内容:
      • 搜索条件(查询条件和时间范围)
      • 找到的跨度数
      • 下一页光标(如果有)
      • 跨度详细信息包括:
        • 服务名称
        • 时间戳
        • 资源名称
        • 持续时间(秒)
        • 主持人
        • 环境
        • 类型
        • 重要属性(http.method、http.url、http.status_code、error)
  3. aggregate_spans
    • 按指定维度聚合 Datadog 中的跟踪跨度
    • 输入:
      • filterQuery (可选字符串):用于过滤聚合跨度的查询字符串(默认值:“*”)
      • filterFrom (可选数字):以秒为单位的 UNIX 时间戳的开始时间(默认值:15 分钟前)
      • filterTo (可选数字):以秒为单位的 UNIX 时间戳的结束时间(默认值:当前时间)
      • groupBy (可选字符串[]):分组依据的维度(例如,[“service”,“resource_name”,“status”])
      • aggregation (可选字符串):聚合方法 - “count”、“avg”、“sum”、“min”、“max”、“pct”(默认值:“count”)
      • interval (可选字符串):时间序列数据的时间间隔(仅当类型为“timeseries”时)
      • type (可选字符串):结果类型,可以是“时间序列”或“总计”(默认值:“时间序列”)
    • 返回:格式化文本,包含以下内容:
      • 聚合结果存储在 buckets 中,每个 buckets 包括:
        • 存储桶 ID
        • 按值分组(如果指定了 groupBy)
        • 根据聚合方法计算的值
      • 附加元数据:
        • 处理时间(已用时间)
        • 请求 ID
        • 地位
        • 警告(如果有)

设置

您需要设置 Datadog API 和应用程序密钥:

  1. Datadog API 密钥页面获取您的 API 密钥和应用程序密钥
  2. 在 datadog-mcp 项目中安装依赖项:
    npm install # or pnpm install
  3. 构建 TypeScript 项目:
    npm run build # or pnpm run build

Docker 设置

您可以使用以下命令使用 Docker 进行构建:

docker build -t datadog-mcp .

与 Claude Desktop 一起使用

要将其与 Claude Desktop 一起使用,请将以下内容添加到您的claude_desktop_config.json中:

{ "mcpServers": { "datadog": { "command": "node", "args": [ "/path/to/datadog-mcp/build/index.js" ], "env": { "DD_API_KEY": "<YOUR_DATADOG_API_KEY>", "DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>" } } } }

如果您使用 Docker,您可以像这样配置它:

{ "mcpServers": { "datadog": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "DD_API_KEY", "-e", "DD_APP_KEY", "datadog-mcp" ], "env": { "DD_API_KEY": "<YOUR_DATADOG_API_KEY>", "DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>" } } } }

与 VS Code 一起使用

要在 VS Code 中快速安装,请配置您的设置:

  1. 在 VS Code 中打开用户设置 (JSON)( Ctrl+Shift+PPreferences: Open User Settings (JSON)
  2. 添加以下配置:
{ "mcp": { "servers": { "datadog": { "command": "node", "args": [ "/path/to/datadog-mcp/build/index.js" ], "env": { "DD_API_KEY": "<YOUR_DATADOG_API_KEY>", "DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>" } } } } }

如果您使用 Docker,您可以像这样配置它:

{ "mcp": { "servers": { "datadog": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "DD_API_KEY", "-e", "DD_APP_KEY", "datadog-mcp" ], "env": { "DD_API_KEY": "<YOUR_DATADOG_API_KEY>", "DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>" } } } } }

或者,您可以将其添加到工作区中的.vscode/mcp.json文件中(不带mcp键):

{ "servers": { "datadog": { "command": "node", "args": [ "/path/to/datadog-mcp/build/index.js" ], "env": { "DD_API_KEY": "<YOUR_DATADOG_API_KEY>", "DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>" } } } }

如果您使用 Docker,您可以像这样配置它:

{ "servers": { "datadog": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "DD_API_KEY", "-e", "DD_APP_KEY", "datadog-mcp" ], "env": { "DD_API_KEY": "<YOUR_DATADOG_API_KEY>", "DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>" } } } }

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

可以与 Datadog 的监控平台交互,以搜索日志、搜索跟踪跨度并执行跟踪跨度聚合以进行分析。

  1. 特征
    1. 工具
      1. 设置
        1. Docker 设置
        2. 与 Claude Desktop 一起使用
        3. 与 VS Code 一起使用

      Related MCP Servers

      • -
        security
        F
        license
        -
        quality
        provide access to monitor and cluster logs from datadog
        Last updated -
        2
        Python
        • Apple
      • -
        security
        F
        license
        -
        quality
        Integrates with Sumo Logic's API to enable log search with configurable queries and time ranges, supporting error handling and easy deployment via Docker.
        Last updated -
        TypeScript
      • A
        security
        A
        license
        A
        quality
        The MCP server provides an interface to the Datadog API, enabling seamless management of incidents, monitoring, logs, dashboards, metrics, traces, and hosts. Its extensible design allows easy integration of additional Datadog APIs for future expansions.
        Last updated -
        14
        322
        36
        TypeScript
        Apache 2.0
        • Apple

      View all related MCP servers

      ID: 3vjdswnx7u