Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@

### Features Added

* Added NET6 target framework.
Comment thread
TimothyMothra marked this conversation as resolved.
([#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.2.0-beta.1 (2024-02-09)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>An OpenTelemetry .NET distro that exports to Azure Monitor</Description>
<AssemblyTitle>AzureMonitor OpenTelemetry ASP.NET Core Distro</AssemblyTitle>
<Version>1.2.0-beta.2</Version>
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
<ApiCompatVersion>1.1.0</ApiCompatVersion>
<!-- TODO: Need to disable this because adding new target framwork. This needs to be reenabled when we release. -->
<!--<ApiCompatVersion>1.1.0</ApiCompatVersion>-->
<PackageTags>Azure Monitor OpenTelemetry Exporter Distro ApplicationInsights</PackageTags>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>net6.0;$(RequiredTargetFrameworks)</TargetFrameworks>
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
<NoWarn>SA1636</NoWarn>
<!-- this is temporary. will remove in future PR. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public Resource Detect()

private static string? GetAzureResourceURI(string websiteSiteName)
{
string websiteResourceGroup = Environment.GetEnvironmentVariable(ResourceAttributeConstants.AppServiceResourceGroupEnvVar);
string? websiteResourceGroup = Environment.GetEnvironmentVariable(ResourceAttributeConstants.AppServiceResourceGroupEnvVar);
string websiteOwnerName = Environment.GetEnvironmentVariable(ResourceAttributeConstants.AppServiceOwnerNameEnvVar) ?? string.Empty;

int idx = websiteOwnerName.IndexOf("+", StringComparison.Ordinal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#nullable enable

#if !NET6_0_OR_GREATER
Comment thread
TimothyMothra marked this conversation as resolved.
Outdated

using System;
using System.Collections;
using System.Collections.Generic;
Expand Down Expand Up @@ -83,3 +85,4 @@ private void AddIfNormalizedKeyMatchesPrefix(Dictionary<string, string?> data, s
private static string Normalize(string key) => key.Replace("__", ConfigurationPath.KeyDelimiter);
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#nullable enable

#if !NET6_0_OR_GREATER

namespace Microsoft.Extensions.Configuration.EnvironmentVariables
{
/// <summary>
Expand All @@ -27,3 +29,4 @@ public IConfigurationProvider Build(IConfigurationBuilder builder)
}
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#nullable enable

#if !NET6_0_OR_GREATER

using System;
using Microsoft.Extensions.Configuration.EnvironmentVariables;

Expand Down Expand Up @@ -50,3 +52,4 @@ public static IConfigurationBuilder AddEnvironmentVariables(this IConfigurationB
=> builder.Add(configureSource);
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,4 @@
<ProjectReference Include="..\..\src\Azure.Monitor.OpenTelemetry.AspNetCore.csproj" />
</ItemGroup>

<ItemGroup>
<!-- Workaround to fix CI build failure in macOS. This package is being used indirectly by Azure analyzers. -->
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" VersionOverride="8.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
<ProjectReference Include="..\..\src\Azure.Monitor.OpenTelemetry.AspNetCore.csproj" />
</ItemGroup>

<ItemGroup>
<!-- Workaround to fix CI build failure in macOS. This package is being used indirectly by Azure analyzers. -->
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" VersionOverride="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
<Compile Include="..\..\..\Azure.Monitor.OpenTelemetry.Exporter\tests\Azure.Monitor.OpenTelemetry.Exporter.Tests\CommonTestFramework\TestEventListener.cs" LinkBase="CommonTestFramework" />
</ItemGroup>

<ItemGroup>
<!-- Workaround to fix CI build failure in macOS. This package is being used indirectly by Azure analyzers. -->
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" VersionOverride="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<AssemblyTitle>AzureMonitor OpenTelemetry Live Metrics</AssemblyTitle>
<Version>1.0.0-beta.3</Version>
<PackageTags>Azure Monitor OpenTelemetry live Metrics ApplicationInsights</PackageTags>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>net6.0;$(RequiredTargetFrameworks)</TargetFrameworks>
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
<Nullable>enable</Nullable>
<DefineConstants>$(DefineConstants);LIVE_METRICS_EXPORTER;</DefineConstants>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public IEnumerable<DocumentIngress> 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()!;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Internals.Filtering
{
using System;
Expand Down Expand Up @@ -39,7 +41,7 @@ internal class DerivedMetric<TTelemetry>
/// </summary>
private readonly List<FilterConjunctionGroup<TTelemetry>> filterGroups = new List<FilterConjunctionGroup<TTelemetry>>();

private Func<TTelemetry, double>? projectionLambda;
private Func<TTelemetry, double> projectionLambda;
public DerivedMetric(DerivedMetricInfo info, out CollectionConfigurationError[] errors)
{
if (info == null)
Expand Down Expand Up @@ -120,7 +122,7 @@ private void CreateFilters(out CollectionConfigurationError[] errors)
{
foreach (FilterConjunctionGroupInfo filterConjunctionGroupInfo in this.info.FilterGroups)
{
CollectionConfigurationError[]? groupErrors = null;
CollectionConfigurationError[] groupErrors = null;
try
{
var conjunctionFilterGroup = new FilterConjunctionGroup<TTelemetry>(filterConjunctionGroupInfo, out groupErrors);
Expand Down Expand Up @@ -180,7 +182,7 @@ private void CreateProjection()
else
{
Filter<TTelemetry>.FieldNameType fieldNameType;
Type? fieldType = Filter<TTelemetry>.GetFieldType(this.info.Projection, out fieldNameType);
Type fieldType = Filter<TTelemetry>.GetFieldType(this.info.Projection, out fieldNameType);
if (fieldNameType == Filter<TTelemetry>.FieldNameType.AnyField)
{
throw new ArgumentOutOfRangeException(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable
Comment thread
TimothyMothra marked this conversation as resolved.
Outdated

namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Internals.Filtering
{
using System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,4 @@
<ProjectReference Include="..\..\src\Azure.Monitor.OpenTelemetry.LiveMetrics.csproj" />
</ItemGroup>

<ItemGroup>
<!-- Workaround to fix CI build failure in macOS. This package is being used indirectly by Azure analyzers. -->
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" VersionOverride="8.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
<ProjectReference Include="..\..\src\Azure.Monitor.OpenTelemetry.LiveMetrics.csproj" />
</ItemGroup>

<ItemGroup>
<!-- Workaround to fix CI build failure in macOS. This package is being used indirectly by Azure analyzers. -->
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" VersionOverride="8.0.0" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\..\..\Azure.Monitor.OpenTelemetry.Exporter\tests\Azure.Monitor.OpenTelemetry.Exporter.Tests\CommonTestFramework\EventSourceTestHelper.cs" LinkBase="CommonTestFramework" />
<Compile Include="..\..\..\Azure.Monitor.OpenTelemetry.Exporter\tests\Azure.Monitor.OpenTelemetry.Exporter.Tests\CommonTestFramework\TestEventListener.cs" LinkBase="CommonTestFramework" />
Expand Down