diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md index 8e90d4e757c4..0c206df826a6 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md @@ -8,6 +8,9 @@ for the details. ([#42374](https://github.com/Azure/azure-sdk-for-net/pull/42374)) +* Added NET6 target framework. + ([#42426](https://github.com/Azure/azure-sdk-for-net/pull/42426)) + ### Breaking Changes ### Bugs Fixed @@ -15,6 +18,9 @@ * Will no longer emit `db.statement_type` as a part of SQL custom dimensions. This attribute was removed from the SqlClient Instrumentation Library because it's not a part of the [semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-spans.md#call-level-attributes). +* Fix runtime crash with Microsoft.Bcl.AsyncInterfaces. + ([#42426](https://github.com/Azure/azure-sdk-for-net/pull/42426)) + ### Other Changes * Updated the code of vendored instrumentation library `OpenTelemetry.Instrumentation.SqlClient` from the OpenTelemetry .NET repository. diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Azure.Monitor.OpenTelemetry.AspNetCore.csproj b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Azure.Monitor.OpenTelemetry.AspNetCore.csproj index f23e8e60b3a9..71fb01b9e014 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Azure.Monitor.OpenTelemetry.AspNetCore.csproj +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Azure.Monitor.OpenTelemetry.AspNetCore.csproj @@ -4,9 +4,10 @@ AzureMonitor OpenTelemetry ASP.NET Core Distro 1.2.0-beta.2 - 1.1.0 + + Azure Monitor OpenTelemetry Exporter Distro ApplicationInsights - $(RequiredTargetFrameworks) + net6.0;$(RequiredTargetFrameworks) true SA1636 diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Demo/Azure.Monitor.OpenTelemetry.AspNetCore.Demo.csproj b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Demo/Azure.Monitor.OpenTelemetry.AspNetCore.Demo.csproj index b5abf2dd9cda..22cac9febefc 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Demo/Azure.Monitor.OpenTelemetry.AspNetCore.Demo.csproj +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Demo/Azure.Monitor.OpenTelemetry.AspNetCore.Demo.csproj @@ -8,9 +8,4 @@ - - - - - diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests.csproj b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests.csproj index d9fd0a029283..4d7ab15af3f6 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests.csproj +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests.csproj @@ -13,11 +13,6 @@ - - - - - diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests.csproj b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests.csproj index e5872fb6415a..d8487d51aa6b 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests.csproj +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests.csproj @@ -23,11 +23,6 @@ - - - - - diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/CHANGELOG.md b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/CHANGELOG.md index 6d1c654572c9..fe9ccd6ddec2 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/CHANGELOG.md +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/CHANGELOG.md @@ -9,10 +9,16 @@ * For "Committed Memory", we use [Process.PrivateMemorySize64](https://learn.microsoft.com/dotnet/api/system.diagnostics.process.privatememorysize64). * For "CPU Total (%)", we use the change in [Process.TotalProcessorTime](https://learn.microsoft.com/dotnet/api/system.diagnostics.process.totalprocessortime) over a period of time. This value is normalized by dividing by the number of processors. The formula is `((change in ticks / period) / number of processors)`. +* Added NET6 target framework. + ([#42426](https://github.com/Azure/azure-sdk-for-net/pull/42426)) + ### Breaking Changes ### Bugs Fixed +* Fix runtime crash with Microsoft.Bcl.AsyncInterfaces. + ([#42426](https://github.com/Azure/azure-sdk-for-net/pull/42426)) + ### Other Changes ## 1.0.0-beta.2 (2024-02-09) diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Azure.Monitor.OpenTelemetry.LiveMetrics.csproj b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Azure.Monitor.OpenTelemetry.LiveMetrics.csproj index e0bad2691ef1..e6eb3e4b020e 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Azure.Monitor.OpenTelemetry.LiveMetrics.csproj +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Azure.Monitor.OpenTelemetry.LiveMetrics.csproj @@ -4,7 +4,7 @@ AzureMonitor OpenTelemetry Live Metrics 1.0.0-beta.3 Azure Monitor OpenTelemetry live Metrics ApplicationInsights - $(RequiredTargetFrameworks) + net6.0;$(RequiredTargetFrameworks) true enable $(DefineConstants);LIVE_METRICS_EXPORTER; diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/DocumentBuffer.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/DocumentBuffer.cs index f444075c6572..24ea32364520 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/DocumentBuffer.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/DocumentBuffer.cs @@ -38,7 +38,7 @@ public IEnumerable ReadAllAndClear() { // There is no need to decrement the count since we are clearing the queue. After this operation, the instance will not be used anymore. // The method 'Add' is not called while this method is running; therefore, the count will remain unchanged. - while (_documents.TryDequeue(out DocumentIngress item)) + while (_documents.TryDequeue(out DocumentIngress? item)) { yield return item; } diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/DocumentHelper.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/DocumentHelper.cs index dc304b946c5f..d3d7ed6bb918 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/DocumentHelper.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/DocumentHelper.cs @@ -104,27 +104,27 @@ internal static Request ConvertToRequest(Activity activity) } else if (tag.Key == SemanticConventions.AttributeUrlScheme) { - urlScheme = tag.Value.ToString(); + urlScheme = tag.Value.ToString()!; } else if (tag.Key == SemanticConventions.AttributeServerAddress) { - serverAddress = tag.Value.ToString(); + serverAddress = tag.Value.ToString()!; } else if (tag.Key == SemanticConventions.AttributeServerPort) { - serverPort = tag.Value.ToString(); + serverPort = tag.Value.ToString()!; } else if (tag.Key == SemanticConventions.AttributeUrlPath) { - urlPath = tag.Value.ToString(); + urlPath = tag.Value.ToString()!; } else if (tag.Key == SemanticConventions.AttributeUrlQuery) { - urlQuery = tag.Value.ToString(); + urlQuery = tag.Value.ToString()!; } else if (tag.Key == SemanticConventions.AttributeHttpResponseStatusCode) { - httpResponseStatusCode = tag.Value.ToString(); + httpResponseStatusCode = tag.Value.ToString()!; } } diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/Filtering/DerivedMetric.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/Filtering/DerivedMetric.cs index e3d1e13e35c1..bcbad8d83c16 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/Filtering/DerivedMetric.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/Filtering/DerivedMetric.cs @@ -22,15 +22,15 @@ internal class DerivedMetric private static readonly MethodInfo DoubleParseMethodInfo = typeof(double).GetMethod( "Parse", - new[] { typeof(string), typeof(IFormatProvider) }); + new[] { typeof(string), typeof(IFormatProvider) })!; private static readonly MethodInfo ObjectToStringMethodInfo = typeof(object).GetMethod( "ToString", - BindingFlags.Public | BindingFlags.Instance); + BindingFlags.Public | BindingFlags.Instance)!; private static readonly MethodInfo DoubleToStringMethodInfo = typeof(double).GetMethod( "ToString", - new[] { typeof(IFormatProvider) }); + new[] { typeof(IFormatProvider) })!; private readonly DerivedMetricInfo info; @@ -110,7 +110,7 @@ public double Project(TTelemetry document) public override string ToString() { - return this.info.ToString(); + return this.info.ToString()!; } private void CreateFilters(out CollectionConfigurationError[] errors) diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/Filtering/FilterConjunctionGroup.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/Filtering/FilterConjunctionGroup.cs index fcc7a1918d49..f41c36454b2c 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/Filtering/FilterConjunctionGroup.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Internals/Filtering/FilterConjunctionGroup.cs @@ -81,7 +81,7 @@ private void CreateFilters(out CollectionConfigurationError[] errors) string.Format(CultureInfo.InvariantCulture, "Failed to create a filter {0}.", filterInfo), e, Tuple.Create("FilterFieldName", filterInfo.FieldName), - Tuple.Create("FilterPredicate", filterInfo.Predicate.ToString()), + Tuple.Create("FilterPredicate", filterInfo.Predicate?.ToString() ?? "null"), Tuple.Create("FilterComparand", filterInfo.Comparand))); } } diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/LiveMetricsExtractionProcessor.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/LiveMetricsExtractionProcessor.cs index 8b2307447ea4..d30fd56b3807 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/LiveMetricsExtractionProcessor.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/LiveMetricsExtractionProcessor.cs @@ -59,12 +59,12 @@ public override void OnEnd(Activity activity) } else if (tag.Key == SemanticConventions.AttributeExceptionType) { - exceptionType = tag.Value.ToString(); + exceptionType = tag.Value.ToString()!; continue; } else if (tag.Key == SemanticConventions.AttributeExceptionMessage) { - exceptionMessage = tag.Value.ToString(); + exceptionMessage = tag.Value.ToString()!; continue; } } diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/tests/Azure.Monitor.OpenTelemetry.LiveMetrics.Demo/Azure.Monitor.OpenTelemetry.LiveMetrics.Demo.csproj b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/tests/Azure.Monitor.OpenTelemetry.LiveMetrics.Demo/Azure.Monitor.OpenTelemetry.LiveMetrics.Demo.csproj index 9c2dd371de83..613244ee9ade 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/tests/Azure.Monitor.OpenTelemetry.LiveMetrics.Demo/Azure.Monitor.OpenTelemetry.LiveMetrics.Demo.csproj +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/tests/Azure.Monitor.OpenTelemetry.LiveMetrics.Demo/Azure.Monitor.OpenTelemetry.LiveMetrics.Demo.csproj @@ -15,9 +15,4 @@ - - - - - diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/tests/Azure.Monitor.OpenTelemetry.LiveMetrics.Tests/Azure.Monitor.OpenTelemetry.LiveMetrics.Tests.csproj b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/tests/Azure.Monitor.OpenTelemetry.LiveMetrics.Tests/Azure.Monitor.OpenTelemetry.LiveMetrics.Tests.csproj index e59a8dad4e0b..af35757d4a75 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/tests/Azure.Monitor.OpenTelemetry.LiveMetrics.Tests/Azure.Monitor.OpenTelemetry.LiveMetrics.Tests.csproj +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/tests/Azure.Monitor.OpenTelemetry.LiveMetrics.Tests/Azure.Monitor.OpenTelemetry.LiveMetrics.Tests.csproj @@ -22,11 +22,6 @@ - - - - -