{"_id":"@dreki-gg/pi-datadog","_rev":"5-1cf676c627a5ee720ac695393071b6cf","name":"@dreki-gg/pi-datadog","dist-tags":{"latest":"0.4.1"},"versions":{"0.2.0":{"name":"@dreki-gg/pi-datadog","version":"0.2.0","keywords":["pi-package","pi","datadog","logs","observability"],"author":{"name":"Juan Albarran","email":"jalbarrandev@gmail.com"},"license":"MIT","_id":"@dreki-gg/pi-datadog@0.2.0","maintainers":[{"name":"jalbarrang","email":"jalbarrandev@gmail.com"}],"homepage":"https://github.com/dreki-gg/pi-extensions#readme","bugs":{"url":"https://github.com/dreki-gg/pi-extensions/issues"},"pi":{"extensions":["./extensions/datadog"]},"dist":{"shasum":"44a04a91068240ce843d40388958c8f7543e7445","tarball":"https://registry.npmjs.org/@dreki-gg/pi-datadog/-/pi-datadog-0.2.0.tgz","fileCount":7,"integrity":"sha512-SWri9BqVU9mU0KF6KHy9RkiEAULR1hH7it+PXpZnWh7gZzJSmEk32OmjKDulCmn6tKdBHDudcUPFR6jWA32PeA==","signatures":[{"sig":"MEUCIBmHHY6GqS4ypjwTLXfwGb+tl5ibSIK2eSS6xA1RiOMtAiEAoE7X0LhdyJYKx+NoXHyrfiflZzIbxZKTFZO7j1r9/N0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22563},"type":"module","gitHead":"c48ed25bbb6c9b5441dd1fa2184e5b59313f02f0","scripts":{"lint":"oxlint extensions test","test":"bun test","format":"oxfmt --write extensions test","typecheck":"tsc --noEmit","format:check":"oxfmt --check extensions test"},"_npmUser":{"name":"jalbarrang","email":"jalbarrandev@gmail.com"},"repository":{"url":"git+https://github.com/dreki-gg/pi-extensions.git","type":"git","directory":"packages/datadog"},"_npmVersion":"11.12.1","description":"Datadog log search tools for pi — query production logs with project-aware context","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@datadog/datadog-api-client":"^1.34.0"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.43.0","oxlint":"^1.58.0","bun-types":"^1.3.14","typescript":"^6.0.0","@types/node":"24"},"peerDependencies":{"typebox":"*","@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"typebox":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-datadog_0.2.0_1780120964208_0.8037116528025923","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@dreki-gg/pi-datadog","version":"0.2.4","keywords":["pi-package","pi","datadog","logs","observability"],"author":{"name":"Juan Albarran","email":"jalbarrandev@gmail.com"},"license":"MIT","_id":"@dreki-gg/pi-datadog@0.2.4","maintainers":[{"name":"jalbarrang","email":"jalbarrandev@gmail.com"}],"homepage":"https://github.com/dreki-gg/pi-extensions#readme","bugs":{"url":"https://github.com/dreki-gg/pi-extensions/issues"},"pi":{"extensions":["./extensions/datadog"]},"dist":{"shasum":"c8df1726ba9615ed8b0c302ddc1137429ea47ad2","tarball":"https://registry.npmjs.org/@dreki-gg/pi-datadog/-/pi-datadog-0.2.4.tgz","fileCount":9,"integrity":"sha512-m2tRj9+dK1tTUbZwesljaTVxDFoa5rMmCPmZsIoIN1UI6xPqj0lOYznk/tlouEN2QwmJFZGxcVw3QMaAeexZjg==","signatures":[{"sig":"MEYCIQDUAHM5xAScMqFkM53BaE9bRBmobtBC2H/liWk4051Q+wIhANaOgI4nGwWBG8c9tLBQ1uf3j0kjDUrLCAKlmt2jR5uA","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dreki-gg%2fpi-datadog@0.2.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":34882},"type":"module","gitHead":"a783cca98ea9d494e23c1c3814f9d985ecb184b1","scripts":{"lint":"oxlint extensions test","test":"bun test","format":"oxfmt --write extensions test","typecheck":"tsc --noEmit","format:check":"oxfmt --check extensions test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0ce963ce-901c-40e2-9ee3-6988c7dbd02f"}},"repository":{"url":"git+https://github.com/dreki-gg/pi-extensions.git","type":"git","directory":"packages/datadog"},"_npmVersion":"11.13.0","description":"Datadog log search tools for pi — query production logs with project-aware context","directories":{},"_nodeVersion":"24.16.0","dependencies":{"@datadog/datadog-api-client":"^1.34.0"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.43.0","oxlint":"^1.58.0","bun-types":"^1.3.14","typescript":"^6.0.0","@types/node":"24"},"peerDependencies":{"typebox":"*","@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"typebox":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-datadog_0.2.4_1780532285802_0.10353939398459744","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@dreki-gg/pi-datadog","version":"0.3.0","keywords":["pi-package","pi","datadog","logs","observability"],"author":{"name":"Juan Albarran","email":"jalbarrandev@gmail.com"},"license":"MIT","_id":"@dreki-gg/pi-datadog@0.3.0","maintainers":[{"name":"jalbarrang","email":"jalbarrandev@gmail.com"}],"homepage":"https://github.com/dreki-gg/pi-extensions#readme","bugs":{"url":"https://github.com/dreki-gg/pi-extensions/issues"},"pi":{"extensions":["./extensions/datadog"]},"dist":{"shasum":"3da22c8e49165c17a0e0e270cc8234d81be1be24","tarball":"https://registry.npmjs.org/@dreki-gg/pi-datadog/-/pi-datadog-0.3.0.tgz","fileCount":11,"integrity":"sha512-QxfcSbKulKSQJZprfaf1LhZ4CzkAoo/bsv9a6i2KC19dQjQffAJw+WbQFquPD3B55w/0yahT/WzAtbrsXsY2Hw==","signatures":[{"sig":"MEYCIQC3SBZ+cKN3YIdgjzdvc++qAIBHQylP9ErAqDzFrXKfPAIhANOK3TgSQg6MpKZmpDEVHGQXKUIIcti4CTmUeoYPVpNW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dreki-gg%2fpi-datadog@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":55064},"type":"module","gitHead":"076e9b861fe41ee0e2f6baceb9d689980bb5b687","scripts":{"lint":"oxlint extensions test","test":"bun test","format":"oxfmt --write extensions test","typecheck":"tsc --noEmit","format:check":"oxfmt --check extensions test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0ce963ce-901c-40e2-9ee3-6988c7dbd02f"}},"repository":{"url":"git+https://github.com/dreki-gg/pi-extensions.git","type":"git","directory":"packages/datadog"},"_npmVersion":"11.13.0","description":"Datadog log search tools for pi — query production logs with project-aware context","directories":{},"_nodeVersion":"24.16.0","dependencies":{"@datadog/datadog-api-client":"^1.34.0"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.43.0","oxlint":"^1.58.0","bun-types":"^1.3.14","typescript":"^6.0.0","@types/node":"24"},"peerDependencies":{"typebox":"*","@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"typebox":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-datadog_0.3.0_1780631411819_0.46992155486377296","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@dreki-gg/pi-datadog","version":"0.4.0","keywords":["pi-package","pi","datadog","logs","observability"],"author":{"name":"Juan Albarran","email":"jalbarrandev@gmail.com"},"license":"MIT","_id":"@dreki-gg/pi-datadog@0.4.0","maintainers":[{"name":"jalbarrang","email":"jalbarrandev@gmail.com"}],"homepage":"https://github.com/jalbarrang/pi-datadog#readme","bugs":{"url":"https://github.com/jalbarrang/pi-datadog/issues"},"pi":{"extensions":["./extensions/datadog"]},"dist":{"shasum":"7ae7fe40dfd068c6639b3456b13fc6006f5e1822","tarball":"https://registry.npmjs.org/@dreki-gg/pi-datadog/-/pi-datadog-0.4.0.tgz","fileCount":12,"integrity":"sha512-u06ahNg3cdaJ94htZjDMHIDkqRBOpHPKuUgBJcuiK2CvAoyM+Rm5VRVoE2l7OO57xT+8wn7Bk5XMk5/+uRotQg==","signatures":[{"sig":"MEUCIBWSMAxxaRRlmP9Qr6RGxUtDVsDYTqtilG88R7xVIjqwAiEAsZBrN8M4oIv6oUyesYTSJOJKFH6gJ2RDooRXdICNZSQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dreki-gg%2fpi-datadog@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":56447},"type":"module","gitHead":"166da5c92dd1669c7fafb04f8f2453a3326e21f1","scripts":{"lint":"oxlint extensions test","test":"bun test","format":"oxfmt --write extensions test","typecheck":"tsc --noEmit","format:check":"oxfmt --check extensions test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e74c47d8-d9fb-42ba-b928-c4991f9c178e"}},"repository":{"url":"git+https://github.com/jalbarrang/pi-datadog.git","type":"git"},"_npmVersion":"11.16.0","description":"Datadog log search tools for pi — query production logs with project-aware context","directories":{},"_nodeVersion":"24.18.0","dependencies":{"@datadog/datadog-api-client":"^1.34.0"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.43.0","oxlint":"^1.58.0","typebox":"^1.0.55","bun-types":"^1.3.14","typescript":"^6.0.0","@types/node":"24","@earendil-works/pi-coding-agent":"^0.75.4"},"peerDependencies":{"typebox":"*","@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"typebox":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-datadog_0.4.0_1783788725664_0.730508480391054","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@dreki-gg/pi-datadog","version":"0.4.1","description":"Datadog log search tools for pi — query production logs with project-aware context","keywords":["pi-package","pi","datadog","logs","observability"],"author":{"name":"Juan Albarran","email":"jalbarrandev@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/jalbarrang/pi-datadog.git"},"type":"module","scripts":{"typecheck":"tsc --noEmit","test":"bun test","lint":"oxlint extensions test","format":"oxfmt --write extensions test","format:check":"oxfmt --check extensions test"},"pi":{"extensions":["./extensions/datadog"]},"dependencies":{"@datadog/datadog-api-client":"^1.60.0"},"devDependencies":{"@types/node":"26","bun-types":"^1.3.14","oxfmt":"^0.58.0","oxlint":"^1.73.0","typescript":"^7.0.2","@earendil-works/pi-coding-agent":"^0.80.6","typebox":"^1.3.6"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*","typebox":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true},"typebox":{"optional":true}},"publishConfig":{"access":"public"},"gitHead":"d364b9aa98733cc1effd70d5521172b57a3538b9","_id":"@dreki-gg/pi-datadog@0.4.1","bugs":{"url":"https://github.com/jalbarrang/pi-datadog/issues"},"homepage":"https://github.com/jalbarrang/pi-datadog#readme","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-MfeJZzngcK2yGaQ0RLgd1QE7Ru+wbyUJzz4/YazwkoP5Xi/BoLOqhhKgJ9xjnMQwFf3V2MDjVLs/EE0bl3mkLQ==","shasum":"08a8182742a7be33df9bf71137a1c3b3dce9455c","tarball":"https://registry.npmjs.org/@dreki-gg/pi-datadog/-/pi-datadog-0.4.1.tgz","fileCount":12,"unpackedSize":56803,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dreki-gg%2fpi-datadog@0.4.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAEWjX1AK0Ursucf4z6ZnN6cs+phFihYldjUk2/5D7qNAiADzBXyM6IOXgnXAT4Rkg/lEjQApSaLNMlhuqejh2LDdg=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e74c47d8-d9fb-42ba-b928-c4991f9c178e"}},"directories":{},"maintainers":[{"name":"jalbarrang","email":"jalbarrandev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-datadog_0.4.1_1783827386326_0.09494920698877496"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-30T06:02:44.066Z","modified":"2026-07-12T03:36:26.793Z","0.2.0":"2026-05-30T06:02:44.376Z","0.2.4":"2026-06-04T00:18:05.976Z","0.3.0":"2026-06-05T03:50:11.944Z","0.4.0":"2026-07-11T16:52:05.802Z","0.4.1":"2026-07-12T03:36:26.478Z"},"bugs":{"url":"https://github.com/jalbarrang/pi-datadog/issues"},"author":{"name":"Juan Albarran","email":"jalbarrandev@gmail.com"},"license":"MIT","homepage":"https://github.com/jalbarrang/pi-datadog#readme","keywords":["pi-package","pi","datadog","logs","observability"],"repository":{"type":"git","url":"git+https://github.com/jalbarrang/pi-datadog.git"},"description":"Datadog log search tools for pi — query production logs with project-aware context","maintainers":[{"name":"jalbarrang","email":"jalbarrandev@gmail.com"}],"readme":"# @dreki-gg/pi-datadog\n\nDatadog log and RUM search tools for [pi](https://github.com/earendil-works/pi) — query production logs and Real User Monitoring sessions with project-aware context.\n\n## Setup\n\n### 1. Install\n\n```bash\npi install npm:@dreki-gg/pi-datadog\n```\n\n### 2. Set credentials\n\nExport your Datadog API and Application keys as environment variables:\n\n```bash\nexport DD_API_KEY=\"your-datadog-api-key\"\nexport DD_APP_KEY=\"your-datadog-app-key\"\n```\n\n> **Tip:** Add these to your shell profile (`~/.zshrc`, `~/.bashrc`) or use a `.env` manager. Never commit credentials to version control.\n\nYou need an **Application Key** (not just an API key) because log search uses Datadog's read endpoints.\n\n### 3. Configure your project (optional)\n\nCreate `.pi/datadog.json` in your project root to set defaults:\n\n```json\n{\n  \"service\": \"my-api\",\n  \"env\": \"production\",\n  \"site\": \"datadoghq.com\",\n  \"defaultTags\": [\"team:backend\"],\n  \"defaultTimeRange\": \"1h\",\n  \"rumApplicationId\": \"abcd-1234\",\n  \"rumService\": \"web-frontend\"\n}\n```\n\n| Field | Description | Default |\n|-------|-------------|---------|\n| `service` | Default service name for queries | _(none)_ |\n| `env` | Default environment | _(none)_ |\n| `site` | Datadog site | `datadoghq.com` |\n| `defaultTags` | Tags auto-appended to every query | `[]` |\n| `defaultTimeRange` | Default lookback window | `1h` |\n| `rumApplicationId` | Default RUM application id (`@application.id`) for RUM searches | _(none)_ |\n| `rumService` | Default service for RUM searches (falls back to `service`) | _(none)_ |\n\n**Supported sites:** `datadoghq.com` (US1), `us3.datadoghq.com`, `us5.datadoghq.com`, `datadoghq.eu` (EU).\n\n## Usage\n\n### Natural language\n\nJust ask pi to search your logs:\n\n```\n> Show me the errors in production from the last 30 minutes\n> What's causing the 500 errors on the payments service?\n> Find logs with \"timeout\" in staging from the past 24 hours\n```\n\nThe agent uses your `.pi/datadog.json` defaults automatically — you don't need to specify service or environment unless you want to override them.\n\nYou can also ask about front-end / RUM sessions:\n\n```\n> Show me RUM sessions from the last hour\n> Find RUM errors on the checkout view in production\n> What views did users hit in the last 30 minutes?\n```\n\n### Tool: `datadog_logs_search`\n\nThe agent calls this tool with [Datadog query syntax](https://docs.datadoghq.com/logs/explorer/search_syntax/):\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `query` | `string` | **Required.** Datadog log query (e.g. `status:error`, `@http.status_code:500`) |\n| `from` | `string` | Start time — relative (`15m`, `1h`, `7d`) or ISO 8601 |\n| `to` | `string` | End time — relative, ISO 8601, or `now` |\n| `limit` | `number` | Max results (1–100, default 25) |\n| `sort` | `string` | `newest` or `oldest` |\n| `service` | `string` | Override project default service |\n| `env` | `string` | Override project default environment |\n\nThe agent receives a compact inline digest (counts, status breakdown, services). The full, untruncated log entries are written to a temp file whose path is in the response — the agent reads that file with the `read` tool to inspect actual content.\n\n### Tool: `datadog_rum_search`\n\nSearches Datadog RUM events (sessions, views, actions, front-end errors) with [RUM query syntax](https://docs.datadoghq.com/real_user_monitoring/explorer/search_syntax/). Defaults to **session** events (`@type:session`) when the query omits `@type`.\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `query` | `string` | **Required.** RUM query (e.g. `@type:session`, `@type:error`, `@view.url_path:/checkout`). Leave empty to list recent sessions |\n| `from` | `string` | Start time — relative (`15m`, `1h`, `7d`) or ISO 8601 |\n| `to` | `string` | End time — relative, ISO 8601, or `now` |\n| `limit` | `number` | Max results (1–100, default 25) |\n| `sort` | `string` | `newest` or `oldest` |\n| `service` | `string` | Override project default RUM service |\n| `env` | `string` | Override project default environment |\n| `applicationId` | `string` | Override project default RUM application id (`@application.id`) |\n\nLike the logs tool, it returns a compact digest inline (counts, event-type breakdown, services) and writes the full events to a `rum-*.md` temp file the agent can `read`.\n\n### Command: `/datadog`\n\nCheck your configuration and connection status:\n\n```\n/datadog\n```\n\nShows: credential status (set/missing), project config (service, env, site, tags, RUM application, RUM service).\n\n## Query Syntax Examples\n\n```\nstatus:error                          # All errors\nservice:my-api status:error           # Errors for a specific service\n@http.status_code:500                 # 500 errors\n\"connection refused\"                  # Full-text search\nservice:my-api env:production @duration:>5000  # Slow requests\n```\n\nSee the [Datadog Log Search Syntax docs](https://docs.datadoghq.com/logs/explorer/search_syntax/) for the full reference.\n\n### RUM query examples\n\n```\n@type:session                          # User sessions (the default)\n@type:error                            # Front-end errors\n@type:view @view.url_path:/checkout    # Views on the checkout page\n@type:session @session.type:user       # Real user sessions (exclude synthetics)\n@application.id:abcd-1234 @type:action # Actions in a specific RUM application\n```\n\nSee the [RUM Search Syntax docs](https://docs.datadoghq.com/real_user_monitoring/explorer/search_syntax/) for the full reference.\n\n## How It Works\n\n1. The extension loads `.pi/datadog.json` from your project on session start\n2. When the agent calls `datadog_logs_search`, it merges your query with project defaults (service, env, tags)\n3. Results are formatted as markdown with status icons, truncated messages, and key attributes\n4. The agent receives structured metadata (status breakdown, services found) to summarize intelligently\n\n## License\n\nMIT\n","readmeFilename":"README.md"}