Andrew McIntosh
08/12/2025, 2:22 AMMarvin
08/12/2025, 2:22 AMMarvin
08/12/2025, 2:23 AM<https://http-intake.logs.datadoghq.com/api/v2/logs>
(use the EU site if applicable)
- Method: POST
- Headers:
- Content-Type: application/json
- DD-API-KEY: <your-datadog-api-key>
- Body (simple, template-friendly):
[
{
"ddsource": "prefect",
"service": "prefect-cloud",
"message": "{{ event.event }}: {{ event.resource.name or 'n/a' }}",
"timestamp": "{{ event.occurred }}",
"attributes": {{ event | tojson }}
}
]
Notes and caveats
- This gives you near-real-time streaming. If you need historical bulk export, there isn’t a dedicated “export audit log” API endpoint today; events+automations is the supported path.
- Be selective with event filters—org-level events can be noisy.
- If you actually meant “runtime flow/task logs,” that’s different; you’d typically ship logs directly from your execution environment to Datadog using a logging handler or agent.
Docs
- Automations overview: https://docs.prefect.io/latest/automations/
- Events (what you can trigger on): https://docs.prefect.io/latest/automations/events/
- Webhook actions: https://docs.prefect.io/latest/automations/actions/
- Datadog logs HTTP intake: https://docs.datadoghq.com/api/latest/logs/#send-logs
Quick sanity check
- Are you on Prefect Cloud, and do you want org/audit events (users, tokens, roles) or runtime flow/task logs? I’ll tailor the exact event filters or logging approach accordingly.