Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Resources.AWS] Remove .NET 6 target and add .NET Standard 2.0 #2164

Merged
merged 5 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/OpenTelemetry.Resources.AWS/AWSECSDetector.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#if !NETFRAMEWORK
#if NET
using System.Text.Json;
using System.Text.RegularExpressions;

Expand Down
6 changes: 2 additions & 4 deletions src/OpenTelemetry.Resources.AWS/AWSEKSDetector.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#if !NETFRAMEWORK
#if NET
using System.Text;
using OpenTelemetry.Resources.AWS.Models;

Expand Down Expand Up @@ -62,7 +62,7 @@ internal static List<KeyValuePair<string, object>> ExtractResourceAttributes(str
{
try
{
var stringBuilder = new StringBuilder();
var stringBuilder = new StringBuilder("Bearer ");

using (var streamReader = ResourceDetectorUtils.GetStreamReader(path))
{
Expand All @@ -72,8 +72,6 @@ internal static List<KeyValuePair<string, object>> ExtractResourceAttributes(str
}
}

stringBuilder.Insert(0, "Bearer ");

return stringBuilder.ToString();
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static ResourceBuilder AddAWSEC2Detector(this ResourceBuilder builder)
return builder.AddDetector(new AWSEC2Detector());
}

#if !NETFRAMEWORK
#if NET
/// <summary>
/// Enables AWS ECS resource detector.
/// </summary>
Expand Down
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Resources.AWS/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* Updated OpenTelemetry core component version(s) to `1.9.0`.
([#1888](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1888))

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

## 1.5.0-beta.1

Released 2024-Jun-04
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +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 - AWS Resource Detectors for ElasticBeanstalk, EC2, ECS, EKS.</Description>
<Description>OpenTelemetry Resource Detectors for AWS ElasticBeanstalk, EC2, ECS, EKS.</Description>
<MinVerTagPrefix>Resources.AWS-</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)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<PackageReference Include="System.Text.Json" Version="6.0.0" />
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonPkgVer)" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/OpenTelemetry.Resources.AWS/ResourceDetectorUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#endif
using System.Text;
using System.Text.Json;
#if !NETFRAMEWORK
#if NET
using System.Text.Json.Serialization.Metadata;
#endif

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 AWS 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 AWS Detector for OpenTelemetry.</Description>
</PropertyGroup>

<ItemGroup>
Expand All @@ -25,7 +25,6 @@
<None Update="ecs_metadata\metadatav4-response-task-fargate.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

</ItemGroup>

<ItemGroup>
Expand Down
Loading