From db971784e78e8442699cb14c0f26e0d08fd66a28 Mon Sep 17 00:00:00 2001 From: FernandoNunes Date: Tue, 24 Jan 2023 09:57:26 +0000 Subject: [PATCH 1/4] Enable Nulls on Contrib.Extensions.AWSXRay & Test Projects --- .../OpenTelemetry.Contrib.Extensions.AWSXRay.csproj | 3 ++- .../OpenTelemetry.Contrib.Extensions.AWSXRay.Tests.csproj | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/OpenTelemetry.Contrib.Extensions.AWSXRay.csproj b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/OpenTelemetry.Contrib.Extensions.AWSXRay.csproj index 1064cc11a9..00fe8202db 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/OpenTelemetry.Contrib.Extensions.AWSXRay.csproj +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/OpenTelemetry.Contrib.Extensions.AWSXRay.csproj @@ -1,8 +1,9 @@ - + net452;netstandard2.0 OpenTelemetry extensions for AWS X-Ray. Extensions.AWSXRay- + enable diff --git a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests.csproj b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests.csproj index aeaadfb5ad..a59f6efe9f 100644 --- a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests.csproj +++ b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests.csproj @@ -4,6 +4,7 @@ Unit test project for AWS X-Ray for OpenTelemetry netcoreapp3.1 $(TargetFrameworks);net452 + enable From 9d42863b4e1264b2befe4f4f5d01fd6976bb7357 Mon Sep 17 00:00:00 2001 From: FernandoNunes Date: Tue, 24 Jan 2023 13:04:42 +0000 Subject: [PATCH 2/4] Fixed Project Warnings of Nullable Reference Types --- .../netstandard2.0/PublicAPI.Shipped.txt | 25 +++++++++-------- .../AWSXRayIdGenerator.cs | 2 +- .../Resources/AWSEBSResourceDetector.cs | 24 ++++++++-------- .../Resources/AWSEC2ResourceDetector.cs | 28 +++++++++---------- .../Resources/AWSECSResourceDetector.cs | 18 ++++++------ .../Resources/AWSEKSResourceDetector.cs | 28 +++++++++---------- .../Resources/AWSLambdaResourceDetector.cs | 18 ++++++------ .../Resources/Http/Handler.cs | 9 ++++-- .../ServerCertificateValidationProvider.cs | 22 ++++++++++----- .../Resources/IResourceDetector.cs | 2 +- .../Resources/Models/AWSEBSMetadataModel.cs | 6 ++-- .../Models/AWSEC2IdentityDocumentModel.cs | 10 +++---- .../Models/AWSEKSClusterDataModel.cs | 2 +- .../Models/AWSEKSClusterInformationModel.cs | 2 +- .../Resources/ResourceDetectorUtils.cs | 8 +++--- ...TestServerCertificateValidationProvider.cs | 2 ++ .../Resources/TestAWSEBSResourceDetector.cs | 7 +++-- .../Resources/TestAWSEC2ResourceDetector.cs | 7 +++-- .../Resources/TestAWSECSResourceDetector.cs | 6 ++-- .../Resources/TestAWSEKSResourceDetector.cs | 8 ++++-- .../TestAWSXRayIdGenerator.cs | 4 +-- 21 files changed, 129 insertions(+), 109 deletions(-) diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/netstandard2.0/PublicAPI.Shipped.txt b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/netstandard2.0/PublicAPI.Shipped.txt index 29e1279fc9..0c8b8d923f 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/netstandard2.0/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/netstandard2.0/PublicAPI.Shipped.txt @@ -1,30 +1,31 @@ +#nullable enable OpenTelemetry.Contrib.Extensions.AWSXRay.AWSXRayIdGenerator OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEBSResourceDetector OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEBSResourceDetector.AWSEBSResourceDetector() -> void -OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEBSResourceDetector.Detect() -> System.Collections.Generic.IEnumerable> +OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEBSResourceDetector.Detect() -> System.Collections.Generic.IEnumerable>? OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEC2ResourceDetector OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEC2ResourceDetector.AWSEC2ResourceDetector() -> void -OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEC2ResourceDetector.Detect() -> System.Collections.Generic.IEnumerable> +OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEC2ResourceDetector.Detect() -> System.Collections.Generic.IEnumerable>? OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSECSResourceDetector OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSECSResourceDetector.AWSECSResourceDetector() -> void -OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSECSResourceDetector.Detect() -> System.Collections.Generic.IEnumerable> +OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSECSResourceDetector.Detect() -> System.Collections.Generic.IEnumerable>? OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEKSResourceDetector OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEKSResourceDetector.AWSEKSResourceDetector() -> void -OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEKSResourceDetector.Detect() -> System.Collections.Generic.IEnumerable> +OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEKSResourceDetector.Detect() -> System.Collections.Generic.IEnumerable>? OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSLambdaResourceDetector OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSLambdaResourceDetector.AWSLambdaResourceDetector() -> void -OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSLambdaResourceDetector.Detect() -> System.Collections.Generic.IEnumerable> +OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSLambdaResourceDetector.Detect() -> System.Collections.Generic.IEnumerable>? OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.IResourceDetector -OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.IResourceDetector.Detect() -> System.Collections.Generic.IEnumerable> +OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.IResourceDetector.Detect() -> System.Collections.Generic.IEnumerable>? OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.ResourceDetectorUtils OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.ResourceDetectorUtils.ResourceDetectorUtils() -> void OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.AWSXRayPropagator() -> void OpenTelemetry.Resources.ResourceBuilderExtensions OpenTelemetry.Trace.TracerProviderBuilderExtensions -override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Extract(OpenTelemetry.Context.Propagation.PropagationContext context, T carrier, System.Func> getter) -> OpenTelemetry.Context.Propagation.PropagationContext -override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Fields.get -> System.Collections.Generic.ISet -override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Inject(OpenTelemetry.Context.Propagation.PropagationContext context, T carrier, System.Action setter) -> void -static OpenTelemetry.Resources.ResourceBuilderExtensions.AddDetector(this OpenTelemetry.Resources.ResourceBuilder resourceBuilder, OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.IResourceDetector resourceDetector) -> OpenTelemetry.Resources.ResourceBuilder -static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddXRayTraceId(this OpenTelemetry.Trace.TracerProviderBuilder builder) -> OpenTelemetry.Trace.TracerProviderBuilder -static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddXRayTraceIdWithSampler(this OpenTelemetry.Trace.TracerProviderBuilder builder, OpenTelemetry.Trace.Sampler sampler) -> OpenTelemetry.Trace.TracerProviderBuilder \ No newline at end of file +override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Extract(OpenTelemetry.Context.Propagation.PropagationContext context, T carrier, System.Func!>! getter) -> OpenTelemetry.Context.Propagation.PropagationContext +override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Fields.get -> System.Collections.Generic.ISet! +override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Inject(OpenTelemetry.Context.Propagation.PropagationContext context, T carrier, System.Action! setter) -> void +static OpenTelemetry.Resources.ResourceBuilderExtensions.AddDetector(this OpenTelemetry.Resources.ResourceBuilder! resourceBuilder, OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.IResourceDetector! resourceDetector) -> OpenTelemetry.Resources.ResourceBuilder! +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddXRayTraceId(this OpenTelemetry.Trace.TracerProviderBuilder! builder) -> OpenTelemetry.Trace.TracerProviderBuilder! +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddXRayTraceIdWithSampler(this OpenTelemetry.Trace.TracerProviderBuilder! builder, OpenTelemetry.Trace.Sampler! sampler) -> OpenTelemetry.Trace.TracerProviderBuilder! diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/AWSXRayIdGenerator.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/AWSXRayIdGenerator.cs index a84843e169..32380686f6 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/AWSXRayIdGenerator.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/AWSXRayIdGenerator.cs @@ -39,7 +39,7 @@ public static class AWSXRayIdGenerator private static readonly Random Global = new Random(); private static object randLock = new object(); - internal static void ReplaceTraceId(Sampler sampler = null) + internal static void ReplaceTraceId(Sampler? sampler = null) { var awsXRayActivityListener = new ActivityListener { diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSEBSResourceDetector.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSEBSResourceDetector.cs index 0b3ffe119a..141464c14e 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSEBSResourceDetector.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSEBSResourceDetector.cs @@ -35,13 +35,13 @@ public class AWSEBSResourceDetector : IResourceDetector /// Detector the required and optional resource attributes from AWS ElasticBeanstalk. /// /// List of key-value pairs of resource attributes. - public IEnumerable> Detect() + public IEnumerable>? Detect() { - List> resourceAttributes = null; + List>? resourceAttributes = null; try { - string filePath = null; + string? filePath = null; #if NETSTANDARD if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { @@ -67,22 +67,22 @@ public IEnumerable> Detect() return resourceAttributes; } - internal List> ExtractResourceAttributes(AWSEBSMetadataModel metadata) + internal List>? ExtractResourceAttributes(AWSEBSMetadataModel? metadata) { - var resourceAttributes = new List>() + var resourceAttributes = new List>() { - new KeyValuePair(AWSSemanticConventions.AttributeCloudProvider, "aws"), - new KeyValuePair(AWSSemanticConventions.AttributeCloudPlatform, "aws_elastic_beanstalk"), - new KeyValuePair(AWSSemanticConventions.AttributeServiceName, "aws_elastic_beanstalk"), - new KeyValuePair(AWSSemanticConventions.AttributeServiceNamespace, metadata.EnvironmentName), - new KeyValuePair(AWSSemanticConventions.AttributeServiceInstanceID, metadata.DeploymentId), - new KeyValuePair(AWSSemanticConventions.AttributeServiceVersion, metadata.VersionLabel), + new KeyValuePair(AWSSemanticConventions.AttributeCloudProvider, "aws"), + new KeyValuePair(AWSSemanticConventions.AttributeCloudPlatform, "aws_elastic_beanstalk"), + new KeyValuePair(AWSSemanticConventions.AttributeServiceName, "aws_elastic_beanstalk"), + new KeyValuePair(AWSSemanticConventions.AttributeServiceNamespace, metadata?.EnvironmentName), + new KeyValuePair(AWSSemanticConventions.AttributeServiceInstanceID, metadata?.DeploymentId), + new KeyValuePair(AWSSemanticConventions.AttributeServiceVersion, metadata?.VersionLabel), }; return resourceAttributes; } - internal AWSEBSMetadataModel GetEBSMetadata(string filePath) + internal AWSEBSMetadataModel? GetEBSMetadata(string filePath) { return ResourceDetectorUtils.DeserializeFromFile(filePath); } diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSEC2ResourceDetector.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSEC2ResourceDetector.cs index 6c6acf5ae0..b6c5908929 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSEC2ResourceDetector.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSEC2ResourceDetector.cs @@ -35,9 +35,9 @@ public class AWSEC2ResourceDetector : IResourceDetector /// Detector the required and optional resource attributes from AWS EC2. /// /// List of key-value pairs of resource attributes. - public IEnumerable> Detect() + public IEnumerable>? Detect() { - List> resourceAttributes = null; + List>? resourceAttributes = null; try { @@ -55,24 +55,24 @@ public IEnumerable> Detect() return resourceAttributes; } - internal List> ExtractResourceAttributes(AWSEC2IdentityDocumentModel identity, string hostName) + internal List> ExtractResourceAttributes(AWSEC2IdentityDocumentModel? identity, string hostName) { - var resourceAttributes = new List>() + var resourceAttributes = new List>() { - new KeyValuePair(AWSSemanticConventions.AttributeCloudProvider, "aws"), - new KeyValuePair(AWSSemanticConventions.AttributeCloudPlatform, "aws_ec2"), - new KeyValuePair(AWSSemanticConventions.AttributeCloudAccountID, identity.AccountId), - new KeyValuePair(AWSSemanticConventions.AttributeCloudAvailableZone, identity.AvailabilityZone), - new KeyValuePair(AWSSemanticConventions.AttributeHostID, identity.InstanceId), - new KeyValuePair(AWSSemanticConventions.AttributeHostType, identity.InstanceType), - new KeyValuePair(AWSSemanticConventions.AttributeCloudRegion, identity.Region), - new KeyValuePair(AWSSemanticConventions.AttributeHostName, hostName), + new KeyValuePair(AWSSemanticConventions.AttributeCloudProvider, "aws"), + new KeyValuePair(AWSSemanticConventions.AttributeCloudPlatform, "aws_ec2"), + new KeyValuePair(AWSSemanticConventions.AttributeCloudAccountID, identity?.AccountId), + new KeyValuePair(AWSSemanticConventions.AttributeCloudAvailableZone, identity?.AvailabilityZone), + new KeyValuePair(AWSSemanticConventions.AttributeHostID, identity?.InstanceId), + new KeyValuePair(AWSSemanticConventions.AttributeHostType, identity?.InstanceType), + new KeyValuePair(AWSSemanticConventions.AttributeCloudRegion, identity?.Region), + new KeyValuePair(AWSSemanticConventions.AttributeHostName, hostName), }; return resourceAttributes; } - internal AWSEC2IdentityDocumentModel DeserializeResponse(string response) + internal AWSEC2IdentityDocumentModel? DeserializeResponse(string response) { return ResourceDetectorUtils.DeserializeFromString(response); } @@ -82,7 +82,7 @@ private string GetAWSEC2Token() return ResourceDetectorUtils.SendOutRequest(AWSEC2MetadataTokenUrl, "PUT", new KeyValuePair(AWSEC2MetadataTokenTTLHeader, "60")).Result; } - private AWSEC2IdentityDocumentModel GetAWSEC2Identity(string token) + private AWSEC2IdentityDocumentModel? GetAWSEC2Identity(string token) { var identity = this.GetIdentityResponse(token); var identityDocument = this.DeserializeResponse(identity); diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSECSResourceDetector.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSECSResourceDetector.cs index fc25011d7d..9331685a8e 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSECSResourceDetector.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSECSResourceDetector.cs @@ -32,9 +32,9 @@ public class AWSECSResourceDetector : IResourceDetector /// Detector the required and optional resource attributes from AWS ECS. /// /// List of key-value pairs of resource attributes. - public IEnumerable> Detect() + public IEnumerable>? Detect() { - List> resourceAttributes = null; + List>? resourceAttributes = null; if (!this.IsECSProcess()) { @@ -55,21 +55,21 @@ public IEnumerable> Detect() return resourceAttributes; } - internal List> ExtractResourceAttributes(string containerId) + internal List> ExtractResourceAttributes(string? containerId) { - var resourceAttributes = new List>() + var resourceAttributes = new List>() { - new KeyValuePair(AWSSemanticConventions.AttributeCloudProvider, "aws"), - new KeyValuePair(AWSSemanticConventions.AttributeCloudPlatform, "aws_ecs"), - new KeyValuePair(AWSSemanticConventions.AttributeContainerID, containerId), + new KeyValuePair(AWSSemanticConventions.AttributeCloudProvider, "aws"), + new KeyValuePair(AWSSemanticConventions.AttributeCloudPlatform, "aws_ecs"), + new KeyValuePair(AWSSemanticConventions.AttributeContainerID, containerId), }; return resourceAttributes; } - internal string GetECSContainerId(string path) + internal string? GetECSContainerId(string path) { - string containerId = null; + string? containerId = null; using (var streamReader = ResourceDetectorUtils.GetStreamReader(path)) { diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSEKSResourceDetector.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSEKSResourceDetector.cs index a58fd0ee60..51c83c24be 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSEKSResourceDetector.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSEKSResourceDetector.cs @@ -38,7 +38,7 @@ public class AWSEKSResourceDetector : IResourceDetector /// Detector the required and optional resource attributes from AWS EKS. /// /// List of key-value pairs of resource attributes. - public IEnumerable> Detect() + public IEnumerable>? Detect() { var credentials = this.GetEKSCredentials(AWSEKSCredentialPath); var httpClientHandler = Handler.Create(AWSEKSCertificatePath); @@ -53,28 +53,28 @@ public IEnumerable> Detect() this.GetEKSContainerId(AWSEKSMetadataFilePath)); } - internal List> ExtractResourceAttributes(string clusterName, string containerId) + internal List> ExtractResourceAttributes(string? clusterName, string? containerId) { - var resourceAttributes = new List>() + var resourceAttributes = new List>() { - new KeyValuePair(AWSSemanticConventions.AttributeCloudProvider, "aws"), - new KeyValuePair(AWSSemanticConventions.AttributeCloudPlatform, "aws_eks"), + new KeyValuePair(AWSSemanticConventions.AttributeCloudProvider, "aws"), + new KeyValuePair(AWSSemanticConventions.AttributeCloudPlatform, "aws_eks"), }; if (!string.IsNullOrEmpty(clusterName)) { - resourceAttributes.Add(new KeyValuePair(AWSSemanticConventions.AttributeK8SClusterName, clusterName)); + resourceAttributes.Add(new KeyValuePair(AWSSemanticConventions.AttributeK8SClusterName, clusterName)); } if (!string.IsNullOrEmpty(containerId)) { - resourceAttributes.Add(new KeyValuePair(AWSSemanticConventions.AttributeContainerID, containerId)); + resourceAttributes.Add(new KeyValuePair(AWSSemanticConventions.AttributeContainerID, containerId)); } return resourceAttributes; } - internal string GetEKSCredentials(string path) + internal string? GetEKSCredentials(string path) { try { @@ -98,7 +98,7 @@ internal string GetEKSCredentials(string path) return null; } - internal string GetEKSContainerId(string path) + internal string? GetEKSContainerId(string path) { try { @@ -122,12 +122,12 @@ internal string GetEKSContainerId(string path) return null; } - internal AWSEKSClusterInformationModel DeserializeResponse(string response) + internal AWSEKSClusterInformationModel? DeserializeResponse(string response) { return ResourceDetectorUtils.DeserializeFromString(response); } - private string GetEKSClusterName(string credentials, HttpClientHandler httpClientHandler) + private string? GetEKSClusterName(string credentials, HttpClientHandler? httpClientHandler) { try { @@ -142,9 +142,9 @@ private string GetEKSClusterName(string credentials, HttpClientHandler httpClien return null; } - private bool IsEKSProcess(string credentials, HttpClientHandler httpClientHandler) + private bool IsEKSProcess(string credentials, HttpClientHandler? httpClientHandler) { - string awsAuth = null; + string? awsAuth = null; try { awsAuth = ResourceDetectorUtils.SendOutRequest(AWSAuthUrl, "GET", new KeyValuePair("Authorization", credentials), httpClientHandler).Result; @@ -157,7 +157,7 @@ private bool IsEKSProcess(string credentials, HttpClientHandler httpClientHandle return !string.IsNullOrEmpty(awsAuth); } - private string GetEKSClusterInfo(string credentials, HttpClientHandler httpClientHandler) + private string GetEKSClusterInfo(string credentials, HttpClientHandler? httpClientHandler) { return ResourceDetectorUtils.SendOutRequest(AWSClusterInfoUrl, "GET", new KeyValuePair("Authorization", credentials), httpClientHandler).Result; } diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSLambdaResourceDetector.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSLambdaResourceDetector.cs index 9fd80e3552..ec163976b7 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSLambdaResourceDetector.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/AWSLambdaResourceDetector.cs @@ -32,9 +32,9 @@ public class AWSLambdaResourceDetector : IResourceDetector /// Detector the required and optional resource attributes from AWS Lambda. /// /// List of key-value pairs of resource attributes. - public IEnumerable> Detect() + public IEnumerable>? Detect() { - List> resourceAttributes = null; + List>? resourceAttributes = null; try { @@ -48,15 +48,15 @@ public IEnumerable> Detect() return resourceAttributes; } - internal List> ExtractResourceAttributes() + internal List> ExtractResourceAttributes() { - var resourceAttributes = new List>() + var resourceAttributes = new List>() { - new KeyValuePair(AWSSemanticConventions.AttributeCloudProvider, "aws"), - new KeyValuePair(AWSSemanticConventions.AttributeCloudPlatform, "aws_lambda"), - new KeyValuePair(AWSSemanticConventions.AttributeCloudRegion, GetAWSRegion()), - new KeyValuePair(AWSSemanticConventions.AttributeFaasName, GetFunctionName()), - new KeyValuePair(AWSSemanticConventions.AttributeFaasVersion, GetFunctionVersion()), + new KeyValuePair(AWSSemanticConventions.AttributeCloudProvider, "aws"), + new KeyValuePair(AWSSemanticConventions.AttributeCloudPlatform, "aws_lambda"), + new KeyValuePair(AWSSemanticConventions.AttributeCloudRegion, GetAWSRegion()), + new KeyValuePair(AWSSemanticConventions.AttributeFaasName, GetFunctionName()), + new KeyValuePair(AWSSemanticConventions.AttributeFaasVersion, GetFunctionVersion()), }; return resourceAttributes; diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Http/Handler.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Http/Handler.cs index f3ef7ae450..5ee545e2dd 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Http/Handler.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Http/Handler.cs @@ -21,19 +21,24 @@ namespace OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.Http; internal class Handler { - public static HttpClientHandler Create(string certificateFile) + public static HttpClientHandler? Create(string certificateFile) { try { ServerCertificateValidationProvider serverCertificateValidationProvider = ServerCertificateValidationProvider.FromCertificateFile(certificateFile); - if (!serverCertificateValidationProvider.IsCertificateLoaded) + if (!serverCertificateValidationProvider.IsCertificateLoaded ?? false) { AWSXRayEventSource.Log.FailedToValidateCertificate(nameof(Handler), "Failed to Load the certificate file into trusted collection"); return null; } + if (serverCertificateValidationProvider.ValidationCallback == null) + { + return null; + } + var clientHandler = new HttpClientHandler(); clientHandler.ServerCertificateCustomValidationCallback = (sender, x509Certificate2, x509Chain, sslPolicyErrors) => diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Http/ServerCertificateValidationProvider.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Http/ServerCertificateValidationProvider.cs index e37f710894..03d725dbd2 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Http/ServerCertificateValidationProvider.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Http/ServerCertificateValidationProvider.cs @@ -27,9 +27,9 @@ internal class ServerCertificateValidationProvider private static readonly ServerCertificateValidationProvider InvalidProvider = new ServerCertificateValidationProvider(null); - private readonly X509Certificate2Collection trustedCertificates; + private readonly X509Certificate2Collection? trustedCertificates; - private ServerCertificateValidationProvider(X509Certificate2Collection trustedCertificates) + private ServerCertificateValidationProvider(X509Certificate2Collection? trustedCertificates) { if (trustedCertificates == null) { @@ -45,9 +45,9 @@ private ServerCertificateValidationProvider(X509Certificate2Collection trustedCe this.IsCertificateLoaded = true; } - public bool IsCertificateLoaded { get; } + public bool? IsCertificateLoaded { get; } - public RemoteCertificateValidationCallback ValidationCallback { get; } + public RemoteCertificateValidationCallback? ValidationCallback { get; } public static ServerCertificateValidationProvider FromCertificateFile(string certificateFile) { @@ -129,9 +129,12 @@ private bool ValidateCertificate(X509Certificate2 cert, X509Chain chain, SslPoli } var trustCertificates = string.Empty; - foreach (var trustCertificate in this.trustedCertificates) + if (this.trustedCertificates != null) { - trustCertificates += " " + trustCertificate.Subject; + foreach (var trustCertificate in this.trustedCertificates) + { + trustCertificates += " " + trustCertificate.Subject; + } } AWSXRayEventSource.Log.FailedToValidateCertificate( @@ -142,8 +145,13 @@ private bool ValidateCertificate(X509Certificate2 cert, X509Chain chain, SslPoli return isSslPolicyPassed && isValidChain && isTrusted; } - private bool HasCommonCertificate(X509Chain chain, X509Certificate2Collection collection) + private bool HasCommonCertificate(X509Chain chain, X509Certificate2Collection? collection) { + if (collection == null) + { + return false; + } + foreach (var chainElement in chain.ChainElements) { foreach (var certificate in collection) diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/IResourceDetector.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/IResourceDetector.cs index ef262b706b..7ee26bd3af 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/IResourceDetector.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/IResourceDetector.cs @@ -28,5 +28,5 @@ public interface IResourceDetector /// Called to get key-value pairs of attribute from detector. /// /// List of key-value pairs of resource attributes. - IEnumerable> Detect(); + IEnumerable>? Detect(); } diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEBSMetadataModel.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEBSMetadataModel.cs index f3acf9d8a0..656fd150c5 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEBSMetadataModel.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEBSMetadataModel.cs @@ -21,11 +21,11 @@ namespace OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.Models; internal class AWSEBSMetadataModel { [JsonProperty(PropertyName = "deployment_id")] - public string DeploymentId { get; set; } + public string? DeploymentId { get; set; } [JsonProperty(PropertyName = "environment_name")] - public string EnvironmentName { get; set; } + public string? EnvironmentName { get; set; } [JsonProperty(PropertyName = "version_label")] - public string VersionLabel { get; set; } + public string? VersionLabel { get; set; } } diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEC2IdentityDocumentModel.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEC2IdentityDocumentModel.cs index 9a9ea20d63..9753ed7af1 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEC2IdentityDocumentModel.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEC2IdentityDocumentModel.cs @@ -18,13 +18,13 @@ namespace OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.Models; internal class AWSEC2IdentityDocumentModel { - public string AccountId { get; set; } + public string? AccountId { get; set; } - public string AvailabilityZone { get; set; } + public string? AvailabilityZone { get; set; } - public string Region { get; set; } + public string? Region { get; set; } - public string InstanceId { get; set; } + public string? InstanceId { get; set; } - public string InstanceType { get; set; } + public string? InstanceType { get; set; } } diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEKSClusterDataModel.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEKSClusterDataModel.cs index e81fbfd050..3dadd91cf6 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEKSClusterDataModel.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEKSClusterDataModel.cs @@ -21,5 +21,5 @@ namespace OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.Models; internal class AWSEKSClusterDataModel { [JsonProperty(PropertyName = "cluster.name")] - public string ClusterName { get; set; } + public string? ClusterName { get; set; } } diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEKSClusterInformationModel.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEKSClusterInformationModel.cs index 78eed916ba..d6193e47ab 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEKSClusterInformationModel.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/Models/AWSEKSClusterInformationModel.cs @@ -18,5 +18,5 @@ namespace OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.Models; internal class AWSEKSClusterInformationModel { - public AWSEKSClusterDataModel Data { get; set; } + public AWSEKSClusterDataModel? Data { get; set; } } diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/ResourceDetectorUtils.cs b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/ResourceDetectorUtils.cs index b0a525424c..74509c9cad 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/ResourceDetectorUtils.cs +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/Resources/ResourceDetectorUtils.cs @@ -29,7 +29,7 @@ namespace OpenTelemetry.Contrib.Extensions.AWSXRay.Resources; /// public class ResourceDetectorUtils { - internal static async Task SendOutRequest(string url, string method, KeyValuePair header, HttpClientHandler handler = null) + internal static async Task SendOutRequest(string url, string method, KeyValuePair header, HttpClientHandler? handler = null) { using (var httpRequestMessage = new HttpRequestMessage()) { @@ -46,16 +46,16 @@ internal static async Task SendOutRequest(string url, string method, Key } } - internal static T DeserializeFromFile(string filePath) + internal static T? DeserializeFromFile(string filePath) { using (var streamReader = GetStreamReader(filePath)) { JsonSerializer serializer = new JsonSerializer(); - return (T)serializer.Deserialize(streamReader, typeof(T)); + return (T?)serializer.Deserialize(streamReader, typeof(T)); } } - internal static T DeserializeFromString(string json) + internal static T? DeserializeFromString(string json) { return JsonConvert.DeserializeObject(json); } diff --git a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/Http/TestServerCertificateValidationProvider.cs b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/Http/TestServerCertificateValidationProvider.cs index 6e1d910cbd..c101ec8c51 100644 --- a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/Http/TestServerCertificateValidationProvider.cs +++ b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/Http/TestServerCertificateValidationProvider.cs @@ -43,6 +43,8 @@ public void TestValidCertificate() chain.Build(certificate); // validates if certificate is valid + Assert.NotNull(serverCertificateValidationProvider); + Assert.NotNull(serverCertificateValidationProvider.ValidationCallback); Assert.True(serverCertificateValidationProvider.ValidationCallback(null, certificate, chain, System.Net.Security.SslPolicyErrors.None)); } } diff --git a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSEBSResourceDetector.cs b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSEBSResourceDetector.cs index 5aad80cc3b..1b3df6c3e8 100644 --- a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSEBSResourceDetector.cs +++ b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSEBSResourceDetector.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System.Collections.Generic; using System.Linq; using OpenTelemetry.Contrib.Extensions.AWSXRay.Resources; using Xunit; @@ -28,9 +27,10 @@ public class TestAWSEBSResourceDetector [Fact] public void TestDetect() { - IEnumerable> resourceAttributes; var ebsResourceDetector = new AWSEBSResourceDetector(); - resourceAttributes = ebsResourceDetector.Detect(); + + var resourceAttributes = ebsResourceDetector.Detect(); + Assert.Null(resourceAttributes); // will be null as it's not in ebs environment } @@ -56,6 +56,7 @@ public void TestGetEBSMetadata() var ebsResourceDetector = new AWSEBSResourceDetector(); var ebsMetadata = ebsResourceDetector.GetEBSMetadata(AWSEBSMetadataFilePath); + Assert.NotNull(ebsMetadata); Assert.Equal("1234567890", ebsMetadata.DeploymentId); Assert.Equal("Test AWS Elastic Beanstalk Environment Name", ebsMetadata.EnvironmentName); Assert.Equal("Test Version", ebsMetadata.VersionLabel); diff --git a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSEC2ResourceDetector.cs b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSEC2ResourceDetector.cs index 424ee1bb32..8fff5c438c 100644 --- a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSEC2ResourceDetector.cs +++ b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSEC2ResourceDetector.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System.Collections.Generic; using System.Linq; using OpenTelemetry.Contrib.Extensions.AWSXRay.Resources; using Xunit; @@ -26,9 +25,10 @@ public class TestAWSEC2ResourceDetector [Fact] public void TestDetect() { - IEnumerable> resourceAttributes; var ec2ResourceDetector = new AWSEC2ResourceDetector(); - resourceAttributes = ec2ResourceDetector.Detect(); + + var resourceAttributes = ec2ResourceDetector.Detect(); + Assert.Null(resourceAttributes); // will be null as it's not in ec2 environment } @@ -59,6 +59,7 @@ public void TestDeserializeResponse() var ec2IdentityDocumentModel = ec2ResourceDetector.DeserializeResponse(ec2IdentityDocument); + Assert.NotNull(ec2IdentityDocumentModel); Assert.Equal("123456789012", ec2IdentityDocumentModel.AccountId); Assert.Equal("us-east-1a", ec2IdentityDocumentModel.AvailabilityZone); Assert.Equal("i-12345678901234567", ec2IdentityDocumentModel.InstanceId); diff --git a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSECSResourceDetector.cs b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSECSResourceDetector.cs index 3f6739960f..73223bb2a7 100644 --- a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSECSResourceDetector.cs +++ b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSECSResourceDetector.cs @@ -15,7 +15,6 @@ // using System; -using System.Collections.Generic; using System.Linq; using OpenTelemetry.Contrib.Extensions.AWSXRay.Resources; using Xunit; @@ -31,9 +30,10 @@ public class TestAWSECSResourceDetector [Fact] public void TestDetect() { - IEnumerable> resourceAttributes; var ecsResourceDetector = new AWSECSResourceDetector(); - resourceAttributes = ecsResourceDetector.Detect(); + + var resourceAttributes = ecsResourceDetector?.Detect(); + Assert.Null(resourceAttributes); // will be null as it's not in ecs environment } diff --git a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSEKSResourceDetector.cs b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSEKSResourceDetector.cs index 99c6b14717..d7689835be 100644 --- a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSEKSResourceDetector.cs +++ b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/Resources/TestAWSEKSResourceDetector.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System.Collections.Generic; using System.Linq; using OpenTelemetry.Contrib.Extensions.AWSXRay.Resources; using Xunit; @@ -29,9 +28,10 @@ public class TestAWSEKSResourceDetector [Fact] public void TestDetect() { - IEnumerable> resourceAttributes; var eksResourceDetector = new AWSEKSResourceDetector(); - resourceAttributes = eksResourceDetector.Detect(); + + var resourceAttributes = eksResourceDetector?.Detect(); + Assert.Null(resourceAttributes); // will be null as it's not in eks environment } @@ -107,6 +107,8 @@ public void TestDeserializeResponse() var eksResourceDetector = new AWSEKSResourceDetector(); var eksClusterInformation = eksResourceDetector.DeserializeResponse(awsEKSClusterInformation); + Assert.NotNull(eksClusterInformation); + Assert.NotNull(eksClusterInformation.Data); Assert.Equal("Test", eksClusterInformation.Data.ClusterName); } } diff --git a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/TestAWSXRayIdGenerator.cs b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/TestAWSXRayIdGenerator.cs index d781ce40d6..ff779da30d 100644 --- a/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/TestAWSXRayIdGenerator.cs +++ b/test/OpenTelemetry.Contrib.Extensions.AWSXRay.Tests/TestAWSXRayIdGenerator.cs @@ -91,7 +91,7 @@ public void TestGenerateTraceIdForRootNodeUsingActivitySourceWithTraceIdBasedSam { using (var activity = activitySource.StartActivity("RootActivity", ActivityKind.Internal)) { - Assert.True(activity.ActivityTraceFlags == ActivityTraceFlags.Recorded); + Assert.True(activity?.ActivityTraceFlags == ActivityTraceFlags.Recorded); } } } @@ -110,7 +110,7 @@ public void TestGenerateTraceIdForRootNodeUsingActivitySourceWithTraceIdBasedSam { using (var activity = activitySource.StartActivity("RootActivity", ActivityKind.Internal)) { - Assert.True(activity.ActivityTraceFlags == ActivityTraceFlags.None); + Assert.True(activity?.ActivityTraceFlags == ActivityTraceFlags.None); } } } From 8be4324334172192b03476c55c17fa8ddf727f0e Mon Sep 17 00:00:00 2001 From: FernandoNunes Date: Wed, 25 Jan 2023 11:51:50 +0000 Subject: [PATCH 3/4] Added missing #nullable enable --- .../.publicApi/net452/PublicAPI.Shipped.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/net452/PublicAPI.Shipped.txt b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/net452/PublicAPI.Shipped.txt index 1f0221c530..82983b4bae 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/net452/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/net452/PublicAPI.Shipped.txt @@ -1,3 +1,4 @@ +#nullable enable OpenTelemetry.Contrib.Extensions.AWSXRay.AWSXRayIdGenerator OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEBSResourceDetector OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEBSResourceDetector.AWSEBSResourceDetector() -> void @@ -18,4 +19,4 @@ override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Fields override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Inject(OpenTelemetry.Context.Propagation.PropagationContext context, T carrier, System.Action setter) -> void static OpenTelemetry.Resources.ResourceBuilderExtensions.AddDetector(this OpenTelemetry.Resources.ResourceBuilder resourceBuilder, OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.IResourceDetector resourceDetector) -> OpenTelemetry.Resources.ResourceBuilder static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddXRayTraceId(this OpenTelemetry.Trace.TracerProviderBuilder builder) -> OpenTelemetry.Trace.TracerProviderBuilder -static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddXRayTraceIdWithSampler(this OpenTelemetry.Trace.TracerProviderBuilder builder, OpenTelemetry.Trace.Sampler sampler) -> OpenTelemetry.Trace.TracerProviderBuilder \ No newline at end of file +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddXRayTraceIdWithSampler(this OpenTelemetry.Trace.TracerProviderBuilder builder, OpenTelemetry.Trace.Sampler sampler) -> OpenTelemetry.Trace.TracerProviderBuilder From 4a96322d82891f05abb1b25bfdd3ca6cbd5672b6 Mon Sep 17 00:00:00 2001 From: FernandoNunes Date: Wed, 25 Jan 2023 17:12:30 +0000 Subject: [PATCH 4/4] Added missing nullability comments to PublicAPI --- .../.publicApi/net452/PublicAPI.Shipped.txt | 18 +++++++++--------- .../.publicApi/net452/PublicAPI.Unshipped.txt | 1 + .../netstandard2.0/PublicAPI.Unshipped.txt | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/net452/PublicAPI.Shipped.txt b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/net452/PublicAPI.Shipped.txt index 82983b4bae..c9c69207b1 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/net452/PublicAPI.Shipped.txt +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/net452/PublicAPI.Shipped.txt @@ -2,21 +2,21 @@ OpenTelemetry.Contrib.Extensions.AWSXRay.AWSXRayIdGenerator OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEBSResourceDetector OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEBSResourceDetector.AWSEBSResourceDetector() -> void -OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEBSResourceDetector.Detect() -> System.Collections.Generic.IEnumerable> +OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEBSResourceDetector.Detect() -> System.Collections.Generic.IEnumerable>? OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEC2ResourceDetector OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEC2ResourceDetector.AWSEC2ResourceDetector() -> void -OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEC2ResourceDetector.Detect() -> System.Collections.Generic.IEnumerable> +OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.AWSEC2ResourceDetector.Detect() -> System.Collections.Generic.IEnumerable>? OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.IResourceDetector -OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.IResourceDetector.Detect() -> System.Collections.Generic.IEnumerable> +OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.IResourceDetector.Detect() -> System.Collections.Generic.IEnumerable>? OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.ResourceDetectorUtils OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.ResourceDetectorUtils.ResourceDetectorUtils() -> void OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.AWSXRayPropagator() -> void OpenTelemetry.Resources.ResourceBuilderExtensions OpenTelemetry.Trace.TracerProviderBuilderExtensions -override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Extract(OpenTelemetry.Context.Propagation.PropagationContext context, T carrier, System.Func> getter) -> OpenTelemetry.Context.Propagation.PropagationContext -override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Fields.get -> System.Collections.Generic.ISet -override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Inject(OpenTelemetry.Context.Propagation.PropagationContext context, T carrier, System.Action setter) -> void -static OpenTelemetry.Resources.ResourceBuilderExtensions.AddDetector(this OpenTelemetry.Resources.ResourceBuilder resourceBuilder, OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.IResourceDetector resourceDetector) -> OpenTelemetry.Resources.ResourceBuilder -static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddXRayTraceId(this OpenTelemetry.Trace.TracerProviderBuilder builder) -> OpenTelemetry.Trace.TracerProviderBuilder -static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddXRayTraceIdWithSampler(this OpenTelemetry.Trace.TracerProviderBuilder builder, OpenTelemetry.Trace.Sampler sampler) -> OpenTelemetry.Trace.TracerProviderBuilder +override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Extract(OpenTelemetry.Context.Propagation.PropagationContext context, T carrier, System.Func!>! getter) -> OpenTelemetry.Context.Propagation.PropagationContext +override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Fields.get -> System.Collections.Generic.ISet! +override OpenTelemetry.Contrib.Extensions.AWSXRay.Trace.AWSXRayPropagator.Inject(OpenTelemetry.Context.Propagation.PropagationContext context, T carrier, System.Action! setter) -> void +static OpenTelemetry.Resources.ResourceBuilderExtensions.AddDetector(this OpenTelemetry.Resources.ResourceBuilder! resourceBuilder, OpenTelemetry.Contrib.Extensions.AWSXRay.Resources.IResourceDetector! resourceDetector) -> OpenTelemetry.Resources.ResourceBuilder! +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddXRayTraceId(this OpenTelemetry.Trace.TracerProviderBuilder! builder) -> OpenTelemetry.Trace.TracerProviderBuilder! +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddXRayTraceIdWithSampler(this OpenTelemetry.Trace.TracerProviderBuilder! builder, OpenTelemetry.Trace.Sampler! sampler) -> OpenTelemetry.Trace.TracerProviderBuilder! diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/net452/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/net452/PublicAPI.Unshipped.txt index e69de29bb2..7dc5c58110 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/net452/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/net452/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index e69de29bb2..7dc5c58110 100644 --- a/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Contrib.Extensions.AWSXRay/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable