From 0415e3e3b0fa46fa7f39e9024475fa408a5a2526 Mon Sep 17 00:00:00 2001 From: FernandoNunes Date: Tue, 24 Jan 2023 23:15:43 +0000 Subject: [PATCH 1/3] Enable Nulls on Contrib.Instrumentation.AWS & Test Projects --- .../.publicApi/net452/PublicAPI.Shipped.txt | 3 +- .../AWSTracingPipelineHandler.cs | 6 +-- .../Implementation/Utils.cs | 4 +- ...lemetry.Contrib.Instrumentation.AWS.csproj | 3 +- .../TracerProviderBuilderExtensions.cs | 2 +- ...y.Contrib.Instrumentation.AWS.Tests.csproj | 17 ++++++ .../Tools/CustomResponses.cs | 20 +++---- .../Tools/CustomWebResponse.cs | 20 +++---- .../Tools/HttpResponseMessageBody.cs | 7 +-- .../Tools/MockHttpRequest.cs | 22 ++++---- .../Tools/MockHttpRequestFactory.cs | 12 ++--- .../Tools/MockWebResponse.cs | 53 +++++++++++-------- .../Tools/Utils.cs | 14 +++-- 13 files changed, 109 insertions(+), 74 deletions(-) diff --git a/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/net452/PublicAPI.Shipped.txt b/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/net452/PublicAPI.Shipped.txt index cb88907ec0..b9b90d106a 100644 --- a/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/net452/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/net452/PublicAPI.Shipped.txt @@ -1,6 +1,7 @@ +#nullable enable OpenTelemetry.Contrib.Instrumentation.AWS.AWSClientInstrumentationOptions OpenTelemetry.Contrib.Instrumentation.AWS.AWSClientInstrumentationOptions.AWSClientInstrumentationOptions() -> void OpenTelemetry.Contrib.Instrumentation.AWS.AWSClientInstrumentationOptions.SuppressDownstreamInstrumentation.get -> bool OpenTelemetry.Contrib.Instrumentation.AWS.AWSClientInstrumentationOptions.SuppressDownstreamInstrumentation.set -> void OpenTelemetry.Trace.TracerProviderBuilderExtensions -static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAWSInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder \ No newline at end of file +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAWSInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder! builder, System.Action? configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder! \ No newline at end of file diff --git a/src/OpenTelemetry.Contrib.Instrumentation.AWS/Implementation/AWSTracingPipelineHandler.cs b/src/OpenTelemetry.Contrib.Instrumentation.AWS/Implementation/AWSTracingPipelineHandler.cs index bbce612cf6..c10ca0bd7f 100644 --- a/src/OpenTelemetry.Contrib.Instrumentation.AWS/Implementation/AWSTracingPipelineHandler.cs +++ b/src/OpenTelemetry.Contrib.Instrumentation.AWS/Implementation/AWSTracingPipelineHandler.cs @@ -73,7 +73,7 @@ public override void InvokeSync(IExecutionContext executionContext) public override async Task InvokeAsync(IExecutionContext executionContext) { - T ret = null; + T? ret = null; var activity = this.ProcessBeginRequest(executionContext); try @@ -100,9 +100,9 @@ public override async Task InvokeAsync(IExecutionContext executionContext) return ret; } - private Activity ProcessBeginRequest(IExecutionContext executionContext) + private Activity? ProcessBeginRequest(IExecutionContext executionContext) { - Activity activity = null; + Activity? activity = null; var requestContext = executionContext.RequestContext; var service = AWSServiceHelper.GetAWSServiceName(requestContext); diff --git a/src/OpenTelemetry.Contrib.Instrumentation.AWS/Implementation/Utils.cs b/src/OpenTelemetry.Contrib.Instrumentation.AWS/Implementation/Utils.cs index 6eec23f4fb..ff51298620 100644 --- a/src/OpenTelemetry.Contrib.Instrumentation.AWS/Implementation/Utils.cs +++ b/src/OpenTelemetry.Contrib.Instrumentation.AWS/Implementation/Utils.cs @@ -21,9 +21,9 @@ namespace OpenTelemetry.Contrib.Instrumentation.AWS.Implementation; internal class Utils { - internal static object GetTagValue(Activity activity, string tagName) + internal static object? GetTagValue(Activity activity, string tagName) { - foreach (KeyValuePair tag in activity.TagObjects) + foreach (KeyValuePair tag in activity.TagObjects) { if (tag.Key.Equals(tagName)) { diff --git a/src/OpenTelemetry.Contrib.Instrumentation.AWS/OpenTelemetry.Contrib.Instrumentation.AWS.csproj b/src/OpenTelemetry.Contrib.Instrumentation.AWS/OpenTelemetry.Contrib.Instrumentation.AWS.csproj index 01adf3f3f5..a71379289d 100644 --- a/src/OpenTelemetry.Contrib.Instrumentation.AWS/OpenTelemetry.Contrib.Instrumentation.AWS.csproj +++ b/src/OpenTelemetry.Contrib.Instrumentation.AWS/OpenTelemetry.Contrib.Instrumentation.AWS.csproj @@ -3,7 +3,8 @@ net452;netstandard2.0 AWS client instrumentation for OpenTelemetry .NET - Instrumentation.AWS- + Instrumentation.AWS- + enable diff --git a/src/OpenTelemetry.Contrib.Instrumentation.AWS/TracerProviderBuilderExtensions.cs b/src/OpenTelemetry.Contrib.Instrumentation.AWS/TracerProviderBuilderExtensions.cs index 80c0d0efed..526d152eec 100644 --- a/src/OpenTelemetry.Contrib.Instrumentation.AWS/TracerProviderBuilderExtensions.cs +++ b/src/OpenTelemetry.Contrib.Instrumentation.AWS/TracerProviderBuilderExtensions.cs @@ -34,7 +34,7 @@ public static class TracerProviderBuilderExtensions /// The instance of to chain the calls. public static TracerProviderBuilder AddAWSInstrumentation( this TracerProviderBuilder builder, - Action configure = null) + Action? configure = null) { Guard.ThrowIfNull(builder); diff --git a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/OpenTelemetry.Contrib.Instrumentation.AWS.Tests.csproj b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/OpenTelemetry.Contrib.Instrumentation.AWS.Tests.csproj index 8b47625fbf..5171a5bcdc 100644 --- a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/OpenTelemetry.Contrib.Instrumentation.AWS.Tests.csproj +++ b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/OpenTelemetry.Contrib.Instrumentation.AWS.Tests.csproj @@ -4,6 +4,23 @@ Unit test project for AWS client instrumentation for OpenTelemetry netcoreapp3.1 $(TargetFrameworks);net452 + enable + + + + $(DefineConstants)TRACE + + + + $(DefineConstants)TRACE + + + + $(DefineConstants)TRACE + + + + $(DefineConstants)TRACE diff --git a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/CustomResponses.cs b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/CustomResponses.cs index 31c9f6837d..abf81a2cb5 100644 --- a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/CustomResponses.cs +++ b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/CustomResponses.cs @@ -36,7 +36,7 @@ internal static class CustomResponses { #if NET452 public static void SetResponse( - AmazonServiceClient client, string content, string requestId, bool isOK) + AmazonServiceClient client, string? content, string requestId, bool isOK) { var response = Create(content, requestId, isOK); SetResponse(client, response); @@ -44,22 +44,22 @@ public static void SetResponse( public static void SetResponse( AmazonServiceClient client, - Func responseCreator) + Func responseCreator) { var pipeline = client .GetType() - .GetProperty("RuntimePipeline", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) + .GetProperty("RuntimePipeline", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)? .GetValue(client, null) as RuntimePipeline; var requestFactory = new MockHttpRequestFactory(); requestFactory.ResponseCreator = responseCreator; var httpHandler = new HttpHandler(requestFactory, client); - pipeline.ReplaceHandler>(httpHandler); + pipeline?.ReplaceHandler>(httpHandler); } - private static Func Create( - string content, string requestId, bool isOK) + private static Func Create( + string? content, string requestId, bool isOK) { var status = isOK ? HttpStatusCode.OK : HttpStatusCode.NotFound; @@ -82,7 +82,7 @@ private static Func Create( }; } #else - public static void SetResponse(AmazonServiceClient client, string content, string requestId, bool isOK) + public static void SetResponse(AmazonServiceClient client, string? content, string requestId, bool isOK) { var response = Create(content, requestId, isOK); SetResponse(client, response); @@ -92,18 +92,18 @@ public static void SetResponse(AmazonServiceClient client, Func(requestFactory, client); - pipeline.ReplaceHandler>(httpHandler); + pipeline?.ReplaceHandler>(httpHandler); } private static Func Create( - string content, string requestId, bool isOK) + string? content, string requestId, bool isOK) { var status = isOK ? HttpStatusCode.OK : HttpStatusCode.NotFound; diff --git a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/CustomWebResponse.cs b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/CustomWebResponse.cs index 9a19394d84..d1dc94d124 100644 --- a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/CustomWebResponse.cs +++ b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/CustomWebResponse.cs @@ -27,16 +27,16 @@ namespace OpenTelemetry.Contrib.Instrumentation.AWS.Tests; internal class CustomWebResponse : IWebResponseData { private HttpResponseMessageBody response; - private string[] headerNames; - private Dictionary headers; - private HashSet headerNamesSet; + private string[]? headerNames; + private Dictionary? headers; + private HashSet? headerNamesSet; public CustomWebResponse(HttpResponseMessage response) : this(response, null, false) { } - public CustomWebResponse(HttpResponseMessage responseMsg, HttpClient httpClient, bool disposeClient) + public CustomWebResponse(HttpResponseMessage responseMsg, HttpClient? httpClient, bool disposeClient) { this.response = new HttpResponseMessageBody(responseMsg, httpClient, disposeClient); @@ -50,7 +50,7 @@ public CustomWebResponse(HttpResponseMessage responseMsg, HttpClient httpClient, public bool IsSuccessStatusCode { get; private set; } - public string ContentType { get; private set; } + public string? ContentType { get; private set; } public long ContentLength { get; private set; } @@ -66,8 +66,8 @@ public static IWebResponseData GenerateWebResponse(HttpResponseMessage response) public string GetHeaderValue(string headerName) { - string headerValue; - if (this.headers.TryGetValue(headerName, out headerValue)) + string? headerValue; + if (this.headers != null && this.headers.TryGetValue(headerName, out headerValue)) { return headerValue; } @@ -77,10 +77,10 @@ public string GetHeaderValue(string headerName) public bool IsHeaderPresent(string headerName) { - return this.headerNamesSet.Contains(headerName); + return this.headerNamesSet != null && this.headerNamesSet.Contains(headerName); } - public string[] GetHeaderNames() + public string[]? GetHeaderNames() { return this.headerNames; } @@ -116,7 +116,7 @@ private void CopyHeaderValues(HttpResponseMessage response) private string GetFirstHeaderValue(HttpHeaders headers, string key) { - IEnumerable headerValues = null; + IEnumerable? headerValues = null; if (headers.TryGetValues(key, out headerValues)) { return headerValues.FirstOrDefault(); diff --git a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/HttpResponseMessageBody.cs b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/HttpResponseMessageBody.cs index d5b8ee4857..65edbf905b 100644 --- a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/HttpResponseMessageBody.cs +++ b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/HttpResponseMessageBody.cs @@ -24,12 +24,12 @@ namespace OpenTelemetry.Contrib.Instrumentation.AWS.Tests; internal class HttpResponseMessageBody : IHttpResponseBody { - private HttpClient httpClient; + private HttpClient? httpClient; private HttpResponseMessage response; private bool disposeClient = false; private bool disposed = false; - public HttpResponseMessageBody(HttpResponseMessage response, HttpClient httpClient, bool disposeClient) + public HttpResponseMessageBody(HttpResponseMessage response, HttpClient? httpClient, bool disposeClient) { this.httpClient = httpClient; this.response = response; @@ -65,7 +65,8 @@ Task IHttpResponseBody.OpenResponseAsync() } else { - return null; + var ms = new MemoryStream(); + return Task.FromResult(ms); } } diff --git a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/MockHttpRequest.cs b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/MockHttpRequest.cs index 5aefb6fc6e..05e761371a 100644 --- a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/MockHttpRequest.cs +++ b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/MockHttpRequest.cs @@ -32,9 +32,9 @@ namespace OpenTelemetry.Contrib.Instrumentation.AWS.Tests; #if NET452 internal class MockHttpRequest : IHttpRequest { - private Stream requestStream = null; + private Stream? requestStream = null; - public MockHttpRequest(Uri requestUri, Action action, Func responseCreator = null) + public MockHttpRequest(Uri requestUri, Action? action, Func? responseCreator = null) { this.RequestUri = requestUri; this.GetResponseAction = action; @@ -51,13 +51,13 @@ public MockHttpRequest(Uri requestUri, Action action, Func ResponseCreator { get; set; } + public Func ResponseCreator { get; set; } public void ConfigureRequest(IRequestContext requestContext) { @@ -106,7 +106,7 @@ public Task GetRequestContentAsync() return Task.FromResult(new MemoryStream()); } - public Task GetResponseAsync(System.Threading.CancellationToken cancellationToken) + public Task GetResponseAsync(CancellationToken cancellationToken) { this.GetResponseAction?.Invoke(); @@ -144,7 +144,7 @@ private HttpWebResponse CreateResponse(MockHttpRequest request) var resourceName = request.RequestUri.Host.Split('.').Last(); var response = MockWebResponse.CreateFromResource(resourceName); - if (response.StatusCode >= HttpStatusCode.OK && response.StatusCode <= (HttpStatusCode)299) + if (response?.StatusCode >= HttpStatusCode.OK && response.StatusCode <= (HttpStatusCode)299) { return response; } @@ -157,7 +157,7 @@ private HttpWebResponse CreateResponse(MockHttpRequest request) #else internal class MockHttpRequest : IHttpRequest { - public MockHttpRequest(Uri requestUri, Action action, Func responseCreator = null) + public MockHttpRequest(Uri requestUri, Action? action, Func? responseCreator = null) { this.RequestUri = requestUri; this.GetResponseAction = action; @@ -174,11 +174,11 @@ public MockHttpRequest(Uri requestUri, Action action, Func ResponseCreator { get; set; } @@ -206,7 +206,7 @@ public HttpContent GetRequestContent() } catch (AggregateException e) { - throw e.InnerException; + throw e.InnerException ?? e; } } diff --git a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/MockHttpRequestFactory.cs b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/MockHttpRequestFactory.cs index 69584cc84f..67605511f3 100644 --- a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/MockHttpRequestFactory.cs +++ b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/MockHttpRequestFactory.cs @@ -27,11 +27,11 @@ namespace OpenTelemetry.Contrib.Instrumentation.AWS.Tests; #if NET452 internal class MockHttpRequestFactory : IHttpRequestFactory { - public Action GetResponseAction { get; set; } + public Action? GetResponseAction { get; set; } - public Func ResponseCreator { get; set; } + public Func? ResponseCreator { get; set; } - public MockHttpRequest LastCreatedRequest { get; private set; } + public MockHttpRequest? LastCreatedRequest { get; private set; } public IHttpRequest CreateHttpRequest(Uri requestUri) { @@ -46,11 +46,11 @@ public void Dispose() #else internal class MockHttpRequestFactory : IHttpRequestFactory { - public Action GetResponseAction { get; set; } + public Action? GetResponseAction { get; set; } - public MockHttpRequest LastCreatedRequest { get; private set; } + public MockHttpRequest? LastCreatedRequest { get; private set; } - public Func ResponseCreator { get; set; } + public Func? ResponseCreator { get; set; } public IHttpRequest CreateHttpRequest(Uri requestUri) { diff --git a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/MockWebResponse.cs b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/MockWebResponse.cs index 46e41168f8..cad99085df 100644 --- a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/MockWebResponse.cs +++ b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/MockWebResponse.cs @@ -31,7 +31,7 @@ namespace OpenTelemetry.Contrib.Instrumentation.AWS.Tests; internal class MockWebResponse { #if NET452 - public static HttpWebResponse CreateFromResource(string resourceName) + public static HttpWebResponse? CreateFromResource(string resourceName) { var rawResponse = Utils.GetResourceText(resourceName); var response = ParseRawReponse(rawResponse); @@ -39,11 +39,16 @@ public static HttpWebResponse CreateFromResource(string resourceName) return Create(statusCode, response.Headers, response.Body); } - public static HttpWebResponse Create(HttpStatusCode statusCode, IDictionary headers, string body = null) + public static HttpWebResponse? Create(HttpStatusCode statusCode, IDictionary? headers, string? body = null) { var type = typeof(HttpWebResponse); var assembly = Assembly.GetAssembly(type); - var obj = assembly.CreateInstance("System.Net.HttpWebResponse"); + var obj = assembly?.CreateInstance("System.Net.HttpWebResponse") as HttpWebResponse; + + if (obj == null) + { + return null; + } var webHeaders = new WebHeaderCollection(); if (headers != null) @@ -54,9 +59,8 @@ public static HttpWebResponse Create(HttpStatusCode statusCode, IDictionary headers, string body = null) + public static HttpResponseMessage Create(HttpStatusCode statusCode, IDictionary? headers, string? body = null) { + HttpResponseMessage? httpResponseMessage = null; var type = typeof(HttpResponseMessage); var assembly = Assembly.GetAssembly(type); - var obj = assembly.CreateInstance("System.Net.Http.HttpResponseMessage"); + if (assembly != null) + { + httpResponseMessage = assembly.CreateInstance("System.Net.Http.HttpResponseMessage") as HttpResponseMessage; + } + + httpResponseMessage ??= new HttpResponseMessage(statusCode); - HttpResponseMessage httpResponseMessage = obj as HttpResponseMessage; var webHeaders = new WebHeaderCollection(); if (headers != null) { foreach (var header in headers) { webHeaders.Add(header.Key, header.Value); - httpResponseMessage.Headers.Add(header.Key, header.Value); + httpResponseMessage?.Headers.Add(header.Key, header.Value); } } @@ -116,7 +125,7 @@ public static HttpResponseMessage Create(HttpStatusCode statusCode, IDictionary< #endif public static HttpResponse ParseRawReponse(string rawResponse) { - var response = new HttpResponse(); + HttpResponse response = new HttpResponse(); response.StatusLine = rawResponse; var responseLines = rawResponse.Split('\n'); @@ -149,7 +158,7 @@ public static HttpResponse ParseRawReponse(string rawResponse) { var headerKey = currentLine.Substring(0, index); var headerValue = currentLine.Substring(index + 1); - response.Headers.Add(headerKey.Trim(), headerValue.Trim()); + response.Headers?.Add(headerKey.Trim(), headerValue.Trim()); } } } @@ -159,12 +168,12 @@ public static HttpResponse ParseRawReponse(string rawResponse) return response; } - private static HttpStatusCode ParseStatusCode(string statusLine) + private static HttpStatusCode ParseStatusCode(string? statusLine) { var statusCode = string.Empty; try { - statusCode = statusLine.Split(' ')[1]; + statusCode = (statusLine ?? string.Empty).Split(' ')[1]; return (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), statusCode); } catch (Exception exception) @@ -180,10 +189,10 @@ public HttpResponse() this.Headers = new Dictionary(); } - public string StatusLine { get; set; } + public string? StatusLine { get; set; } - public IDictionary Headers { get; private set; } + public IDictionary? Headers { get; private set; } - public string Body { get; set; } + public string? Body { get; set; } } } diff --git a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/Utils.cs b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/Utils.cs index 635f5efabf..211e7242fa 100644 --- a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/Utils.cs +++ b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/Tools/Utils.cs @@ -35,17 +35,23 @@ public static Stream CreateStreamFromString(string s) return stream; } - public static Stream GetResourceStream(string resourceName) + public static Stream? GetResourceStream(string resourceName) { Assembly assembly = typeof(Utils).Assembly; var resource = FindResourceName(resourceName); - Stream stream = assembly.GetManifestResourceStream(resource); + Stream? stream = assembly.GetManifestResourceStream(resource); return stream; } public static string GetResourceText(string resourceName) { - using (StreamReader reader = new StreamReader(GetResourceStream(resourceName))) + var stream = GetResourceStream(resourceName); + if (stream == null) + { + return string.Empty; + } + + using (StreamReader reader = new StreamReader(stream)) { return reader.ReadToEnd(); } @@ -69,7 +75,7 @@ public static IEnumerable FindResourceName(Predicate match) } } - public static object GetTagValue(Activity activity, string tagName) + public static object? GetTagValue(Activity activity, string tagName) { return Implementation.Utils.GetTagValue(activity, tagName); } From 42de0595cf044ddda1a9a3b169d4e85989ea3be0 Mon Sep 17 00:00:00 2001 From: FernandoNunes Date: Wed, 25 Jan 2023 11:46:45 +0000 Subject: [PATCH 2/3] Added missing #nullable enable Removed unnecessary Test project settings --- .../netstandard2.0/PublicAPI.Shipped.txt | 3 ++- ...etry.Contrib.Instrumentation.AWS.Tests.csproj | 16 ---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/netstandard2.0/PublicAPI.Shipped.txt b/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/netstandard2.0/PublicAPI.Shipped.txt index cb88907ec0..f15eb36255 100644 --- a/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/netstandard2.0/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/netstandard2.0/PublicAPI.Shipped.txt @@ -1,6 +1,7 @@ +#nullable enable OpenTelemetry.Contrib.Instrumentation.AWS.AWSClientInstrumentationOptions OpenTelemetry.Contrib.Instrumentation.AWS.AWSClientInstrumentationOptions.AWSClientInstrumentationOptions() -> void OpenTelemetry.Contrib.Instrumentation.AWS.AWSClientInstrumentationOptions.SuppressDownstreamInstrumentation.get -> bool OpenTelemetry.Contrib.Instrumentation.AWS.AWSClientInstrumentationOptions.SuppressDownstreamInstrumentation.set -> void OpenTelemetry.Trace.TracerProviderBuilderExtensions -static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAWSInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder \ No newline at end of file +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAWSInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder diff --git a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/OpenTelemetry.Contrib.Instrumentation.AWS.Tests.csproj b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/OpenTelemetry.Contrib.Instrumentation.AWS.Tests.csproj index 5171a5bcdc..ac65e566b7 100644 --- a/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/OpenTelemetry.Contrib.Instrumentation.AWS.Tests.csproj +++ b/test/OpenTelemetry.Contrib.Instrumentation.AWS.Tests/OpenTelemetry.Contrib.Instrumentation.AWS.Tests.csproj @@ -7,22 +7,6 @@ enable - - $(DefineConstants)TRACE - - - - $(DefineConstants)TRACE - - - - $(DefineConstants)TRACE - - - - $(DefineConstants)TRACE - - From 51801c348bb7492ef768f8104231add1e79aaea1 Mon Sep 17 00:00:00 2001 From: FernandoNunes Date: Wed, 25 Jan 2023 17:14:26 +0000 Subject: [PATCH 3/3] Added missing nullability annotations to PublicAPI --- .../.publicApi/net452/PublicAPI.Unshipped.txt | 1 + .../.publicApi/netstandard2.0/PublicAPI.Shipped.txt | 2 +- .../.publicApi/netstandard2.0/PublicAPI.Unshipped.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/net452/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/net452/PublicAPI.Unshipped.txt index e69de29bb2..7dc5c58110 100644 --- a/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/net452/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/net452/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/netstandard2.0/PublicAPI.Shipped.txt b/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/netstandard2.0/PublicAPI.Shipped.txt index f15eb36255..3906c385a7 100644 --- a/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/netstandard2.0/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/netstandard2.0/PublicAPI.Shipped.txt @@ -4,4 +4,4 @@ OpenTelemetry.Contrib.Instrumentation.AWS.AWSClientInstrumentationOptions.AWSCli OpenTelemetry.Contrib.Instrumentation.AWS.AWSClientInstrumentationOptions.SuppressDownstreamInstrumentation.get -> bool OpenTelemetry.Contrib.Instrumentation.AWS.AWSClientInstrumentationOptions.SuppressDownstreamInstrumentation.set -> void OpenTelemetry.Trace.TracerProviderBuilderExtensions -static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAWSInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAWSInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder! builder, System.Action? configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder! diff --git a/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index e69de29bb2..7dc5c58110 100644 --- a/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Contrib.Instrumentation.AWS/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable