dd-trace-rb icon indicating copy to clipboard operation
dd-trace-rb copied to clipboard

Sidekiq:Add trace correlation for internal logs

Open marcotc opened this issue 6 months ago • 6 comments

Fixes #1068

This PR ensures that a trace is active so that Sidekiq's logger instance can emit correlated logs before and after a job is executed.

Motivation:

By default, Sidekiq logs a few messages before and after a job is executed in the Sidekiq server process. These messages happen outside the context of Sidekiq server's middlewares. And because APM traces are created from a servers middleware, these log entries are not correlated with an APM trace.

These logs are important because they are emitted by default, and not having them correlated with traces creates a bad experience out-of-the-box when inspecting the logs from a new Sidekiq server.

How to test the change? There are new integration tests to run a realistic Sidekiq server.

marcotc avatar Aug 01 '24 22:08 marcotc