Add support for RestSharp versions between 106.6.10 and 107.x #1352
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.
Description
This PR uses the instrumentation assembly version filtering to add support for RestSharp clients with versions greater than 106.6.10 (the previous highest tested/supported version) and less than 107.x.
The two main changes required were:
ExecuteAsync(RestSharp.IRestRequest,System.Threading.CancellationToken)
method in newer 106.x versions instead ofExecuteTaskAsync(RestSharp.IRestRequest,System.Threading.CancellationToken)
, using the same wrapper.ConfigureWebRequest(System.String,System.Uri)
method as a point to add our tracing data headers in newer 106.x versions, since theAppendHeaders
method we previously instrumented was changed to a local method with no arguments. A new wrapper is used for this, since ConfigureWebRequest returns an HttpWebRequest rather than accepting one as an argument as AppendHeaders did.Note: because we are filtering on assembly version, not package version, and because some of the RestSharp versions between 106.6.10 and 107.x have the AssemblyVersion set to "106.0.0.0", we will only be able to claim support for some of the newer versions, full list TBD (and will definitely be documented on our public docs). I'll also put that info in the changelog when I do that before this PR is merged.
Author Checklist
Performance testing completed with satisfactory results (if required)Reviewer Checklist