dd-trace-rb
dd-trace-rb copied to clipboard
Extract context clearing logic for ActiveSupport events
When gems that utilize thread pools are instrumented it is very important to ensure that the thread-bound Context
does not leak information between executions.
We have existing logic to clear the Context
for a few integrations that instrument using ActiveSupport events.
This PR extracts that logic to a central place, adds a health metric to count how many times the context is leaking and cleans up testing for integrations affected.
Now that #824 has been merged, I'm rebasing this on master instead.
Rebased, ready for review again.