Datadog
Export Datadog logs from Log Explorer, then hand them to Sleuth.
Export from Datadog
- Open Logs → Log Explorer. Filter to the incident window and service (
service:checkout-worker status:error). - Click the ⚙ → Download as JSON (or NDJSON) button above the list.
- Save as
dd-incident.json.
Sleuth auto-detects all three common Datadog shapes:
- NDJSON with the modern envelope:
{"id": "...", "attributes": {"timestamp": ..., "service": ..., "status": ..., "message": ...}}. - The REST v2 response wrapper:
{"data": [{"attributes": {...}}, ...], "meta": {...}}— the top-leveldataarray is auto-flattened. - Legacy
contentenvelope:{"id": "...", "content": {"timestamp": ..., ...}}.
Fields normalized: attributes.timestamp → ts, attributes.service → service, attributes.status → level, attributes.message → msg. Nested attributes.attributes.trace_id survives in raw.
Ask
sleuth ask "why are payment-gateway 401s spiking?" \
--logs ./dd-incident.json \
--out payment-incident.sleuth.json
Notes
- If you have the Datadog CLI and an API key,
datadog-cican dump a search result to NDJSON in a shell script — Sleuth will read that directly. trace_idfields are preserved in the raw row, so the agent can cross-reference traces when you ask.