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

[HttpClient] Remove SDK dependency #5077

Merged

Conversation

vishweshbankwar
Copy link
Member

@vishweshbankwar vishweshbankwar commented Nov 22, 2023

Fixes #4809
Design discussion issue #

Changes

Removes the SDK dependency from http client instrumentation. Note that with this change, the SuppressDownstreamInstrumentation will no longer work. We can bring the dependency back for pre-release versions to support SuppressDownstreamInstrumentation.

For details on how this change impact users, see open-telemetry/opentelemetry-dotnet-contrib#1727

Merge requirement checklist

  • CONTRIBUTING guidelines followed (nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@vishweshbankwar vishweshbankwar changed the title [HttpClient] Remove sdk dependency [HttpClient] Remove SDK dependency Nov 22, 2023
Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Merging #5077 (a7f1350) into main (4e390e3) will decrease coverage by 0.10%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    open-telemetry/opentelemetry-dotnet#5077      +/-   ##
==========================================
- Coverage   83.15%   83.06%   -0.10%     
==========================================
  Files         296      296              
  Lines       12351    12340      -11     
==========================================
- Hits        10271    10250      -21     
- Misses       2080     2090      +10     
Flag Coverage Δ
unittests 83.06% <ø> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...mentation.Http/HttpClientInstrumentationOptions.cs 100.00% <ø> (ø)
...tp/Implementation/HttpHandlerDiagnosticListener.cs 71.75% <ø> (-0.43%) ⬇️
...ementation/HttpHandlerMetricsDiagnosticListener.cs 88.46% <ø> (+1.42%) ⬆️
...umentation.Http/TracerProviderBuilderExtensions.cs 100.00% <ø> (ø)

... and 5 files with indirect coverage changes

Comment on lines 141 to 144
/// <summary>
/// Gets or sets a value indicating whether suppresses http instrumentation when the http call is part of grpc client call.
/// </summary>
public bool SuppressInstrumentationWhenGrpcIsPresent { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

I think we should ship this new option as experimental. The option is useful as a stop gap, but I do not think it's ultimately what we want. We have an open issue with a different, more generic, proposal #4641 though it is only focused on suppressing tracing. The nice thing about our current suppression functionality is that it works to suppress all signals.

The ability to suppress downstream instrumentation is a long running open issue in the specification. Ultimately, I believe this will be functionality provided by the API not the SDK.

I am ok with this PR if we remove the dependency on the SDK from the HTTP instrumentation and ship this option specifically targeting gRPC as experimental.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the option proposed for now. Will bring SDK dependency back after the stable release. Was hoping to use EXPOSE_EXPERIMENTAL_FEATURES but it is not possible to use as is without additional changes in build. We can discuss the possible options (the one I proposed and existing one post GA release).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm in favor of removing the SDK dependency. We could address the issue for Grpc instrumentation library users after the stable release.

@vishweshbankwar vishweshbankwar marked this pull request as ready for review November 28, 2023 21:17
@vishweshbankwar vishweshbankwar requested a review from a team as a code owner November 28, 2023 21:17
@@ -278,7 +278,7 @@ public async Task InjectsHeadersAsync_CustomFormat()
}));
}

[Fact]
[Fact(Skip = "Removed for stable release of http instrumentation")]
Copy link
Member

Choose a reason for hiding this comment

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

lets add a link to a tracking gh issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that is my TODO on PR desc :D. Wanted to confirm everyone agrees with this proposal.

Copy link
Member

Choose a reason for hiding this comment

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

Also add in PR desc and/or changelog the full impact of this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

@@ -2,6 +2,14 @@

## Unreleased

* **Breaking Change** :
[SuppressDownstreamInstrumentation](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.GrpcNetClient#suppressdownstreaminstrumentation)
option will no longer be supported when used with certain versions of
Copy link
Contributor

Choose a reason for hiding this comment

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

Not for this PR but we should write the exact version here when we do the release.

@utpilla utpilla merged commit 6a829dd into open-telemetry:main Nov 29, 2023
78 checks passed
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.

Remove dependency on SDK
4 participants