Add ddtrace v2 compatability #2120
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was changed
This PR adds support for dd-trace-go v2 within the
contrib/datadog/tracerintegration in two ways. First it updates the existing interceptor to use the latest v1 version of dd-trace-go: v1.74.6, which adds a backwards-compatible compatibility layer between v1 & v2. Next I created a new nested v2 module where all the existing interceptor files were copied over followed by updating the version to v2.3.0, which as expected was no longer buildable due to breaking API changes. I updated all of these locations to make sure the module could build once again and pass all unit tests.Why?
The version used was pretty old (v1.58.1) and cannot be used the dd-trace-go/v2 module is in use. We learned this the hard way when we found that certain services that have upgraded no longer included temporal workflows in their traces. I bumped the dd-trace-go version to v1.74.6 to allow backwards compatibility for all dd-trace-go users.
However, there's still a potential issue. This makes it so v1 will remain in use and newer features will no be usable through the v1 version if they are in use. Therefore to handle this I created the nested v2 version. We can move this to another location or come up with another strategy for this, but this version does not contain any v1 dependencies and handles all of the breaking changes allowing v1 to no longer be included and allowing the full feature set of dd-trace-go v2.
Checklist
Documentation should be updated to point users to the correct package based on the based on the version of dd-trace-go currently in use.
NOTE: IN DRAFT UNTIL TESTING COMPLETED