npx skills add ...
npx skills add datadog-labs/pup --skill dd-logs
Log management - search, pipelines, archives, and cost control.
npx skills add datadog-labs/pup --skill dd-logs
Search, process, and archive logs with cost awareness.
Datadog Pup (dd-pup/pup) should already be installed:
| Query | Meaning |
|---|---|
error | Full-text search |
status:error | Tag equals |
@http.status_code:500 | Attribute equals |
@http.status_code:>=400 | Numeric range |
service:api AND env:prod | Boolean |
@message:*timeout* | Wildcard |
Logs that show a linked trace in the Datadog UI may not include dd.trace_id /
dd.span_id in API results. When a trace ID attribute is remapped for trace
correlation (via JSON preprocessing or a Trace Remapper processor), the source
attribute is removed and the value is stored as an internal attribute that the
Logs Search API does not return. The UI's "trace" link reads that internal
attribute, so UI and API results differ.
This is expected Datadog Log Management behavior, not a pup bug or an instrumentation problem. Do not retry queries or change instrumentation to "fix" it. Datadog is tracking making these values queryable (support reference FRLOGSS-4306).
Workarounds until then:
@custom.trace_id) and query that.pup traces search, or use the trace link in the Datadog UI.Process logs before indexing:
Index only what matters:
| Exclude | Query |
|---|---|
| Health checks | @http.url:"/health" OR @http.url:"/ready" |
| Debug logs | status:debug |
| Static assets | @http.url:*.css OR @http.url:*.js |
| Heartbeats | @message:*heartbeat* |
Store logs cheaply for compliance:
Inspect log-based metrics:
⚠️ Cardinality warning: Group by bounded values only.
| Problem | Fix |
|---|---|
| Logs not appearing | Check agent, pipeline filters |
| High costs | Add exclusion filters |
| Search slow | Narrow time range, use indexes |
| Missing attributes | Check grok parser |
dd.trace_id missing but UI shows a trace | Expected: remapped trace IDs become internal attributes (see Trace IDs in Log Results) |