How to Insert Datadog Trace IDs or Other Custom Info into Auth0 Logs

Problem statement

This article explains how to correlate Auth0 logs in Datadog with the traces that triggered those logs, and whether it is possible to pass a trace ID into Auth0 requests and customize Auth0’s log output to include the trace.

Solution

To add additional parameters to requests, use /authorize method explained here: webAuth.authorize(), which is then retrievable in the event.request.query object in Login Actions explained here Actions Triggers: post-login - Event Object.

However, adding custom data into streams/logs is not currently supported. One workaround might be to pass logs directly to Datadog from Rules/Actions (eg, using HTTP requests or an npm library like datadog-metrics).