Skip to content

Commit

Permalink
Merge branch 'main' into resourcesaws-tfm
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch authored Oct 4, 2024
2 parents 59cd1c9 + 1f7c44e commit 78aa4be
Show file tree
Hide file tree
Showing 50 changed files with 177 additions and 130 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [net6.0, net8.0]
version: [net8.0]
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
Expand Down
1 change: 0 additions & 1 deletion build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<DefineConstants>$(DefineConstants);SIGNED</DefineConstants>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<NetFrameworkMinimumSupportedVersion>net462</NetFrameworkMinimumSupportedVersion>
<NetMinimumSupportedVersion>net6.0</NetMinimumSupportedVersion>
<NetStandardMinimumSupportedVersion>netstandard2.0</NetStandardMinimumSupportedVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AnalysisLevel>latest-all</AnalysisLevel>
Expand Down
2 changes: 1 addition & 1 deletion build/stylecop.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"documentationRules": {
Expand Down
2 changes: 1 addition & 1 deletion build/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"maxParallelThreads": 1,
"parallelizeTestCollections": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Logging": {
"LogLevel": {
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}
}
}
}
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.
([#2160](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2160))

## 1.9.0-beta.1

Released 2024-Jul-23
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;netstandard2.0;net462</TargetFrameworks>
<Description>StackExchange.Redis instrumentation for OpenTelemetry .NET</Description>
<TargetFrameworks>net8.0;$(NetStandardMinimumSupportedVersion);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>StackExchange.Redis instrumentation for OpenTelemetry .NET.</Description>
<PackageTags>$(PackageTags);distributed-tracing;Redis;StackExchange.Redis</PackageTags>
<MinVerTagPrefix>Instrumentation.StackExchangeRedis-</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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
<Description>OpenTelemetry Persistent Storage Abstractions</Description>
<TargetFrameworks>$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Persistent Storage Abstractions.</Description>
<NoWarn>$(NoWarn);1591</NoWarn>
<MinVerTagPrefix>PersistentStorage-</MinVerTagPrefix>
<PackageValidationBaselineVersion>1.0.0</PackageValidationBaselineVersion>
<NoWarn>$(NoWarn),1591</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
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.Container/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.
([#2166](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2166))

## 1.0.0-beta.9

Released 2024-Jun-18
Expand Down
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Resources.Container/ContainerDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ private static string RemovePrefixAndSuffixIfNeeded(string input, int startIndex
{
containerId = GetIdFromLineV1(line);
}
#if NET
else if (cgroupVersion == ParseMode.V2 && line.Contains(Hostname, StringComparison.Ordinal))
#else
else if (cgroupVersion == ParseMode.V2 && line.Contains(Hostname))
#endif
{
containerId = GetIdFromLineV2(line);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>$(NetMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Extensions - Container Resource Detector from Container environment.</Description>
<TargetFrameworks>net8.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Resource Detectors for Container environment.</Description>
<MinVerTagPrefix>Resources.Container-</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 @@
<Compile Include="$(RepoRoot)\src\Shared\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" />
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
</ItemGroup>

</Project>
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 Google Cloud Platform environments</Description>
<TargetFrameworks>net8.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry Resource Detectors for Google Cloud Platform environments.</Description>
<PackageTags>$(PackageTags);ResourceDetector</PackageTags>
<MinVerTagPrefix>Resources.Gcp-</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 @@ -24,4 +25,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
Loading

0 comments on commit 78aa4be

Please sign in to comment.