Log correlation with Datadog and slog in Go

Injecting Trace IDs into your Logging

It’s been a while since I posted anything, but this took more time to get working than I care to admit. So, I thought I’d make a few notes about it, firstly for future reference, but also in case it’s useful to anyone else.

Essentially though, this post outlines how to add a trace ID to your logs in order to correlate them with your traces. Specifically in this case we’re using Datadog and the new structured logging package (slog) from the Go standard library.

[Read More]