Skip to content

Commit

Permalink
Merge branch 'main' into resourcescontainer-tfm
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch authored Oct 4, 2024
2 parents f3de11d + 5e7c50d commit c9ff8f5
Show file tree
Hide file tree
Showing 18 changed files with 85 additions and 54 deletions.
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Resources.Azure/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Drop support for .NET 6 as this target is no longer supported and add .NET 8 target.
([#2165](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2165))

## 1.0.0-beta.9

Released 2024-Sep-24
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<Description>OpenTelemetry Resource Detectors for Azure cloud environments</Description>
<TargetFrameworks>net8.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Resource Detectors for Azure cloud environments.</Description>
<PackageTags>$(PackageTags);ResourceDetector</PackageTags>
<MinVerTagPrefix>Resources.Azure-</MinVerTagPrefix>
</PropertyGroup>

<!--Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property.-->
<!-- Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property. -->
<PropertyGroup>
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
</PropertyGroup>
Expand All @@ -23,4 +24,5 @@
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
<Compile Include="$(RepoRoot)\src\Shared\ResourceSemanticConventions.cs" Link="Includes\ResourceSemanticConventions.cs"/>
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Resources.Host/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Drop support for .NET 6 as this target is no longer supported
and add .NET 8/.NET Standard 2.0 targets.
([#2168](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2168))

## 0.1.0-beta.3

Released 2024-Aug-30
Expand Down
20 changes: 10 additions & 10 deletions src/OpenTelemetry.Resources.Host/HostDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

using System.Diagnostics;
#if NET
#if !NETFRAMEWORK
using System.Runtime.InteropServices;
#endif
using System.Text;
Expand All @@ -18,7 +18,7 @@ internal sealed class HostDetector : IResourceDetector
{
private const string ETCMACHINEID = "/etc/machine-id";
private const string ETCVARDBUSMACHINEID = "/var/lib/dbus/machine-id";
#if NET
#if !NETFRAMEWORK
private readonly Func<OSPlatform, bool> isOsPlatform;
#endif
private readonly Func<IEnumerable<string>> getFilePaths;
Expand All @@ -30,7 +30,7 @@ internal sealed class HostDetector : IResourceDetector
/// </summary>
public HostDetector()
: this(
#if NET
#if !NETFRAMEWORK
RuntimeInformation.IsOSPlatform,
#endif
GetFilePaths,
Expand All @@ -39,7 +39,7 @@ public HostDetector()
{
}

#if NET
#if !NETFRAMEWORK
public HostDetector(
Func<IEnumerable<string>> getFilePaths,
Func<string?> getMacOsMachineId,
Expand All @@ -54,21 +54,21 @@ public HostDetector(
#endif

internal HostDetector(
#if NET
#if !NETFRAMEWORK
Func<OSPlatform, bool> isOsPlatform,
#endif
Func<IEnumerable<string>> getFilePaths,
Func<string?> getMacOsMachineId,
Func<string?> getWindowsMachineId)
{
#if NET
#if !NETFRAMEWORK
Guard.ThrowIfNull(isOsPlatform);
#endif
Guard.ThrowIfNull(getFilePaths);
Guard.ThrowIfNull(getMacOsMachineId);
Guard.ThrowIfNull(getWindowsMachineId);

#if NET
#if !NETFRAMEWORK
this.isOsPlatform = isOsPlatform;
#endif
this.getFilePaths = getFilePaths;
Expand Down Expand Up @@ -117,10 +117,10 @@ public Resource Detect()

foreach (var line in lines)
{
#if NETFRAMEWORK
if (line.IndexOf("IOPlatformUUID", StringComparison.OrdinalIgnoreCase) >= 0)
#else
#if NET
if (line.Contains("IOPlatformUUID", StringComparison.OrdinalIgnoreCase))
#else
if (line.IndexOf("IOPlatformUUID", StringComparison.OrdinalIgnoreCase) >= 0)
#endif
{
var parts = line.Split('"');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Extensions - Host Resource Detector.</Description>
<Description>OpenTelemetry Resource Detectors for Host.</Description>
<MinVerTagPrefix>Resources.Host-</MinVerTagPrefix>
</PropertyGroup>

<!--Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property.-->
<!-- Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property. -->
<PropertyGroup>
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OpenTelemetry" Version="$(OpenTelemetryCoreLatestVersion)" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
<Compile Include="$(RepoRoot)\src\Shared\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Resources.OperatingSystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Drop support for .NET 6 as this target is no longer supported
and add .NET 8/.NET Standard 2.0 targets.
([#2169](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2169))

## 0.1.0-alpha.4

Released 2024-Sep-09
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Extensions - Operating System Resource Detector for .NET</Description>
<Description>OpenTelemetry Resource Detectors for Operating System.</Description>
<MinVerTagPrefix>Resources.OperatingSystem-</MinVerTagPrefix>
</PropertyGroup>

<!--Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property.-->
<!-- Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property. -->
<PropertyGroup>
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OpenTelemetry" Version="$(OpenTelemetryCoreLatestVersion)" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#if NET
#if !NETFRAMEWORK
using System.Runtime.InteropServices;
#endif
#if NET
using System.Xml.Linq;
#endif

using static OpenTelemetry.Resources.OperatingSystem.OperatingSystemSemanticConventions;

namespace OpenTelemetry.Resources.OperatingSystem;
Expand All @@ -18,16 +19,16 @@ internal sealed class OperatingSystemDetector : IResourceDetector
private const string RegistryKey = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion";
private const string KernelOsRelease = "/proc/sys/kernel/osrelease";
private static readonly string[] DefaultEtcOsReleasePaths =
[
"/etc/os-release",
"/usr/lib/os-release"
];
[
"/etc/os-release",
"/usr/lib/os-release"
];

private static readonly string[] DefaultPlistFilePaths =
[
"/System/Library/CoreServices/SystemVersion.plist",
"/System/Library/CoreServices/ServerVersion.plist"
];
[
"/System/Library/CoreServices/SystemVersion.plist",
"/System/Library/CoreServices/ServerVersion.plist"
];

private readonly string? osType;
private readonly string? registryKey;
Expand Down
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Resources.Process/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Drop support for .NET 6 as this target is no longer supported
and add .NET 8/.NET Standard 2.0 targets.
([#2170](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2170))

## 0.1.0-beta.3

Released 2024-Sep-25
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Extensions - Process Resource Detector.</Description>
<Description>OpenTelemetry Resource Detectors for Process.</Description>
<MinVerTagPrefix>Resources.Process-</MinVerTagPrefix>
</PropertyGroup>

<!--Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property.-->
<!-- Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property. -->
<PropertyGroup>
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
</PropertyGroup>
Expand All @@ -20,4 +21,5 @@
<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Resources.ProcessRuntime/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Drop support for .NET 6 as this target is no longer supported
and add .NET 8/.NET Standard 2.0 targets.
([#2171](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2171))

## 0.1.0-beta.2

Released 2024-Jun-18
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Extensions - Process Runtime Resource Detector for .NET runtime.</Description>
<Description>OpenTelemetry Resource Detectors for Process Runtime.</Description>
<MinVerTagPrefix>Resources.ProcessRuntime-</MinVerTagPrefix>
</PropertyGroup>

<!--Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property.-->
<!-- Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property. -->
<PropertyGroup>
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
</PropertyGroup>
Expand All @@ -21,4 +22,5 @@
<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>OpenTelemetry Semantic Conventions</Description>
<TargetFramework>$(NetStandardMinimumSupportedVersion)</TargetFramework>
<Description>OpenTelemetry Semantic Conventions.</Description>
<PackageTags>$(PackageTags);semantic-conventions</PackageTags>
<MinVerTagPrefix>SemanticConventions-</MinVerTagPrefix>
<IsPackable>false</IsPackable>
</PropertyGroup>

<!--Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property.-->
<!-- Do not run Package Baseline Validation as this package has never released a stable version.
Remove this property once we have released a stable version and add PackageValidationBaselineVersion property. -->
<PropertyGroup>
<DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>$(SupportedNetTargets)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
<TargetFrameworks>$(SupportedNetTargetsWithoutNet6)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Unit test project for Host Detector for OpenTelemetry</Description>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>$(SupportedNetTargets)</TargetFrameworks>
<TargetFrameworks>$(SupportedNetTargetsWithoutNet6)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>Unit test project for Host Detector for OpenTelemetry.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Unit test project for Operating System Detector for OpenTelemetry</Description>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>$(SupportedNetTargets)</TargetFrameworks>
<TargetFrameworks>$(SupportedNetTargetsWithoutNet6)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>Unit test project for Operating System Detector for OpenTelemetry.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Unit test project for Process Detector for OpenTelemetry</Description>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>$(SupportedNetTargets)</TargetFrameworks>
<TargetFrameworks>$(SupportedNetTargetsWithoutNet6)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>Unit test project for Process Detector for OpenTelemetry.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Unit test project for Process Runtime Detector for OpenTelemetry</Description>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>$(SupportedNetTargets)</TargetFrameworks>
<TargetFrameworks>$(SupportedNetTargetsWithoutNet6)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>Unit test project for Process Runtime Detector for OpenTelemetry.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit c9ff8f5

Please sign in to comment.