-
Notifications
You must be signed in to change notification settings - Fork 345
[Instrumentation.SqlClient] Adopt shared handle manager #2992
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
base: main
Are you sure you want to change the base?
[Instrumentation.SqlClient] Adopt shared handle manager #2992
Conversation
@matt-hensley, blocking PR merged, could you please rebase/resolve conflicts? |
5fa9f38
to
42ed510
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have applied following changes locally and execute:
.\build\scripts\test-aot-compatibility.ps1 net8.0
.\build\scripts\test-aot-compatibility.ps1 net9.0
both returned
Actual warning count is: 0
Executing test App...
./OpenTelemetry.AotCompatibility.TestApp.exe
Finished executing test App
I know that you have just extracted the code from internal class to shared, but what is the reason to do it, if there is no issues in aot tests?
Diff:
index 2048fffd..85d4f531 100644
--- a/src/Shared/InstrumentationHandleManager.cs
+++ b/src/Shared/InstrumentationHandleManager.cs
@@ -3,18 +3,8 @@
namespace OpenTelemetry.Instrumentation;
-#if NET
-using System.Diagnostics.CodeAnalysis;
-#endif
-
-#if NET
-[RequiresUnreferencedCode(InstrumentationHandleManagerTrimmingUnsupportedMessage)]
-#endif
internal sealed class InstrumentationHandleManager
{
-#if NET
- internal const string InstrumentationHandleManagerTrimmingUnsupportedMessage = "Trimming is not yet supported for InstrumentationHandleManager.";
-#endif
private int metricHandles;
private int tracingHandles;
@@ -40,9 +30,6 @@ internal sealed class InstrumentationHandleManager
/// <returns>An IDisposable object.</returns>
public IDisposable AddTracingHandle() => new TracingHandle(this);
-#if NET
- [RequiresUnreferencedCode(InstrumentationHandleManagerTrimmingUnsupportedMessage)]
-#endif
private sealed class MetricHandle : IDisposable
{
private readonly InstrumentationHandleManager manager;
@@ -64,9 +51,6 @@ internal sealed class InstrumentationHandleManager
}
}
-#if NET
- [RequiresUnreferencedCode(InstrumentationHandleManagerTrimmingUnsupportedMessage)]
-#endif
private sealed class TracingHandle : IDisposable
{
private readonly InstrumentationHandleManager manager;
Changes
Modifies SqlClient instrumentation to use shared handle implementation setup in #2970
Leaving in draft until #2970 lands, will rebase afterwards
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes