From e4376e3466d121b8368133d1fa7f2ed0a6755531 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Jul 2026 20:34:11 +0000 Subject: [PATCH] feat: add Datadog connector AI coder skill Add SKILL.md for the Datadog connector with HTTP proxy usage patterns. Documents createProxyFetch usage for REST API calls with automatic DD-API-KEY + DD-APPLICATION-KEY header injection. Notes region-specific base URLs, API versioning, rate limits, and pagination. --- .../shared/skills/resources_datadog/SKILL.md | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 plugins/shared/skills/resources_datadog/SKILL.md diff --git a/plugins/shared/skills/resources_datadog/SKILL.md b/plugins/shared/skills/resources_datadog/SKILL.md new file mode 100644 index 0000000..dfc62d8 --- /dev/null +++ b/plugins/shared/skills/resources_datadog/SKILL.md @@ -0,0 +1,50 @@ +--- +name: using-datadog-connector +description: Implements Datadog API requests with automatic auth header injection using HTTP proxy and MCP tools. Use when doing ANYTHING that touches a Datadog resource. +--- + +# Major Platform Resource: Datadog + +## Common: Interacting with Resources + +**Security**: Never connect directly to APIs. Never use credentials in code. Always use MCP tools or the HTTP proxy. + +**Two ways to interact with Datadog:** + +1. **MCP tools** (direct, no code needed): Datadog's hosted MCP tools are available through the connector. Use `mcp__resources__list_resources` to discover resources. +2. **HTTP proxy** (Next.js apps): Use `createProxyFetch` from `@major-tech/resource-client/next` to call the Datadog REST API with automatic auth injection. + +**Error handling**: Always check response status codes. Datadog returns standard HTTP errors. + +## HTTP Proxy Usage + +```typescript +import { createProxyFetch } from "@major-tech/resource-client/next"; + +const ddFetch = createProxyFetch({ resourceId: "your-resource-id" }); + +// Query metrics +const response = await ddFetch("/api/v1/query?query=avg:system.cpu.user{*}&from=...&to=..."); +const data = await response.json(); + +// List monitors +const monitors = await ddFetch("/api/v1/monitor"); + +// Search logs +const logs = await ddFetch("/api/v2/logs/events/search", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ + filter: { query: "service:my-service status:error", from: "now-1h", to: "now" }, + page: { limit: 25 }, + }), +}); +``` + +## Tips + +- **Paths are relative to the region-specific API base URL** (e.g., `api.datadoghq.com` for US1) +- **Auth headers (DD-API-KEY and DD-APPLICATION-KEY) are automatically injected** — never set them manually +- Datadog API is versioned: `/api/v1/...` and `/api/v2/...` — check Datadog docs for the correct version +- **Rate limits**: Datadog enforces rate limits per endpoint; check `X-RateLimit-*` response headers +- **Pagination**: Many list endpoints support `page[limit]` and `page[offset]` or cursor-based pagination