Datadog Pup
$ pup 官方出品 中风险Datadog Pup(pup,DataDog/pup / @datadog/pup)是基于 Rust 开发的 Datadog 全栈 CLI,覆盖日志、指标、监控告警、事件与 RUM 等 33+ 产品。专为 AI 编程 Agent 设计,提供结构化 JSON 封装输出(--output json、--no-envelope)、--site/--from 参数及自动 Agent 环境检测。
brew install pup pup 作为毫秒级 Rust 二进制在本地直接调用 33+ Datadog 产品接口并提供标准化 --output json 响应,大幅减少 MCP 工具定义对上下文的占用。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
专为 AI 编程 Agent 构建,提供 --output json、{status, data, metadata} 封装、--no-envelope 与自动 Agent 检测。
--output jsonand--no-envelope/PUP_NO_ENVELOPE=1- Auto-detects AI coding agents and avoids interactive hangs
支持基于 DD_API_KEY/DD_APP_KEY 的最小权限控制,且可通过 --no-agent 关闭自动确认,但写命令会改动线上监控。
--no-agentdisables implicit write auto-approval- Supports scoped Application Keys (
DD_APP_KEY)
高性能 Rust 二进制,支持 Homebrew(brew install pup)、npm/npx(@datadog/pup)与跨平台原生包。
- Available via
brew,npm,npx, and native binaries
单个轻量二进制即可操作 33+ Datadog 产品(日志、指标、告警、APM、RUM、事件)。
- Broad multi-product Datadog API coverage in one CLI
Datadog 官方维护(DataDog/pup),采用 Apache-2.0 协议开源。
- First-party Datadog open-source repository
仓库 README 详细说明了 JSON 封装、Agent 检测、环境变量与各子命令用法。
- Documented in
DataDog/pupREADME and Datadog announcement docs
安全边界、鉴权与放权指南
读取 DD_API_KEY、DD_APP_KEY 与 DD_SITE 环境变量,或通过 pup auth login 将 OAuth2/API 配置保存在本地。
Apache-2.0 开源 CLI 免费;查询遥测数据需配合有效的 Datadog 组织及 API/App 密钥。
# Datadog Pup (pup) Agent Rules - Always pass `--output json` (and `--no-envelope` if raw arrays are needed) and scope queries with `--from` and `--site`. - Note that `pup` auto-detects coding agents and auto-approves write prompts; pass `--no-agent` when strict confirmation is desired. - Use read-only `DD_APP_KEY` scopes for observability triage unless monitor/incident mutations are explicitly approved.
Agent 高频安全命令配方
只读查询(安全推荐)
pup logs search --query "status:error" --from 1h --output json
查询最近一小时的错误日志并返回结构化 JSON 封装结果。
pup monitors list --output json --no-envelope
获取 Datadog 监控项并直接返回原始 API JSON,便于管道接 jq 处理。
受控写入与预演
pup monitors mute <monitor_id> --output json --no-agent
静默指定监控告警,并传入 --no-agent 保持严格的交互确认语义。
核心优势
- + 原生为编程 Agent 设计的
{status, data, metadata}JSON 封装与--no-envelope选项。 - + 单个 Rust 二进制覆盖 33+ 产品,支持
brew与npx @datadog/pup安装。
注意事项与踩坑点
- ! 在自动识别的 Agent 环境中默认开启写操作自动确认(
DD_AUTO_APPROVE),必要时需加--no-agent。 - ! 接口覆盖面极广,建议为排障类 Agent 配置只读权限的
DD_APP_KEY。