Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for RestSharp versions between 106.6.10 and 107.x #1352

Conversation

nr-ahemsath
Copy link
Member

@nr-ahemsath nr-ahemsath commented Jan 19, 2023

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:

  • Instrument the ExecuteAsync(RestSharp.IRestRequest,System.Threading.CancellationToken) method in newer 106.x versions instead of ExecuteTaskAsync(RestSharp.IRestRequest,System.Threading.CancellationToken), using the same wrapper.
  • Instrument the ConfigureWebRequest(System.String,System.Uri) method as a point to add our tracing data headers in newer 106.x versions, since the AppendHeaders 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

Reviewer Checklist

  • Perform code review
  • Pull request was adequately tested (new/existing tests, performance tests)
  • Review Changelog

Copy link
Member

@chynesNR chynesNR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@nr-ahemsath nr-ahemsath merged commit a0aed55 into instrumentation-version-filtering-feature Jan 19, 2023
@nr-ahemsath nr-ahemsath deleted the restsharp-instruentation-version-filtering-106 branch January 19, 2023 22:04
chynesNR added a commit that referenced this pull request Jan 24, 2023
* Instrumentation by assembly version
* Updating precompiled Profiler binaries
* Removed special case System.Net.Http logic (#1344)
* Add support for RestSharp versions between 106.6.10 and 107.x (#1352)
* Updates StackExchange.Redis v2 and above to use a new wrapper with improved performance (#1351)
* Add new StackExchange.Redis instrumentation to MSI
* Add integration test coverage for RestSharp v107+ (#1356)
* Update CHANGELOG.md

Co-authored-by: Alex Hemsath <57361211+nr-ahemsath@users.noreply.github.com>
Co-authored-by: Jacob Affinito <jaffinito@newrelic.com>
Co-authored-by: Josh Coleman <83677148+JcolemanNR@users.noreply.github.com>
Co-authored-by: Josh Coleman <jcoleman@newrelic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants