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

Implement method tracing API

Open jennchenn opened this issue 2 years ago • 0 comments

WIP: Some tasks to be done

  • [x] System tests are failing
  • [ ] Instrumentation API does not support ruby 3.2 at the moment
  • [ ] disable/enable functionality does not seem to be working as intended on instrumentation gem side (i.e. even when hook is disabled, it still produces traces)
  • [ ] Sorbet checks are failing

What does this PR do?

This PR adds a method tracing API that can be used by:

  1. Customers tracing their own code
  2. Customers looking to trace code from gems we don't yet instrument
  3. Us when developing new integrations

Motivation

Method tracing has been requested for a long time by the community. This implementation makes use of the instrumentation API to provide users with an easy interface to implement custom instrumentation.

Additional Notes

The number of changed files is inflated because of the changes to the gemfile. Main change is in the tracing/contrib/hook.rb file.

How to test the change?

Unit tests have been added to test the changes. pg and mysql2 instrumentations were modified as a POC that the API works (the original instrumentation code was not deleted in this branch).

jennchenn avatar Aug 24 '22 21:08 jennchenn