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

[repo] Remove .NET 7 target #2038

Merged
merged 8 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
3 changes: 1 addition & 2 deletions .github/workflows/Component.BuildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
required: false
type: string
tfm-list:
default: '[ "net462", "net6.0", "net7.0", "net8.0" ]'
default: '[ "net462", "net6.0", "net8.0" ]'
required: false
type: string

Expand Down Expand Up @@ -78,7 +78,6 @@ jobs:
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x

- name: dotnet restore ${{ steps.resolve-project.outputs.title }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
version: [ net462, net6.0, net7.0, net8.0 ]
version: [ net462, net6.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ jobs:
with:
project-name: OpenTelemetry.Instrumentation.AspNetCore
code-cov-name: Instrumentation.AspNetCore
tfm-list: '[ "net6.0", "net7.0", "net8.0" ]'
tfm-list: '[ "net6.0", "net8.0" ]'

build-test-instrumentation-aws:
needs: detect-changes
Expand All @@ -219,7 +219,7 @@ jobs:
with:
project-name: Component[OpenTelemetry.Instrumentation.AWSLambda]
code-cov-name: Instrumentation.AWSLambda
tfm-list: '[ "net6.0", "net7.0", "net8.0" ]'
tfm-list: '[ "net6.0", "net8.0" ]'

build-test-instrumentation-cassandra:
needs: detect-changes
Expand Down Expand Up @@ -285,7 +285,7 @@ jobs:
with:
project-name: OpenTelemetry.Instrumentation.EventCounters
code-cov-name: Instrumentation.EventCounters
tfm-list: '[ "net6.0", "net7.0", "net8.0" ]'
tfm-list: '[ "net6.0", "net8.0" ]'

build-test-instrumentation-grpccore:
needs: detect-changes
Expand Down
4 changes: 2 additions & 2 deletions .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, net7.0, net8.0]
version: [net6.0, net8.0]
steps:
- uses: actions/checkout@v4

Expand All @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [net6.0, net7.0, net8.0]
version: [net6.0, net8.0]
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You can contribute to this project from a Windows, macOS or Linux machine.
On all platforms, the minimum requirements are:

* Git client and command line tools.
* .NET 7.0+
* .NET 8.0+

Please note that individual project requirements might vary.

Expand Down
2 changes: 1 addition & 1 deletion build/Common.nonprod.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<MicrosoftNETTestSdkPkgVer>[17.11.0,18.0)</MicrosoftNETTestSdkPkgVer>
<OpenTelemetryExporterInMemoryPkgVer>$(OpenTelemetryCoreLatestVersion)</OpenTelemetryExporterInMemoryPkgVer>
<OpenTelemetryExporterInMemoryLatestPreReleasePkgVer>$(OpenTelemetryCoreLatestPrereleaseVersion)</OpenTelemetryExporterInMemoryLatestPreReleasePkgVer>
<SupportedNetTargets>net8.0;net7.0;net6.0</SupportedNetTargets>
<SupportedNetTargets>net8.0;net6.0</SupportedNetTargets>
<XUnitRunnerVisualStudioPkgVer>[2.8.2,3.0)</XUnitRunnerVisualStudioPkgVer>
<XUnitPkgVer>[2.9.0,3.0)</XUnitPkgVer>
<WiremockNetPkgVer>[1.6.1,2.0)</WiremockNetPkgVer>
Expand Down
9 changes: 0 additions & 9 deletions build/docker-compose.net7.0.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Examples.InfluxDB</RootNamespace>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion opentelemetry-dotnet-contrib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{824BD1DE
build\Common.targets = build\Common.targets
build\debug.snk = build\debug.snk
build\docker-compose.net6.0.yml = build\docker-compose.net6.0.yml
build\docker-compose.net7.0.yml = build\docker-compose.net7.0.yml
build\docker-compose.net8.0.yml = build\docker-compose.net8.0.yml
build\opentelemetry-icon-color.png = build\opentelemetry-icon-color.png
build\OpenTelemetryContrib.prod.ruleset = build\OpenTelemetryContrib.prod.ruleset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ internal static void DisableOpenTelemetrySdkMetricNameValidation()
GetOpenTelemetryInstrumentNameRegexProperty().SetValue(null, GetDisableRegexPattern());
}

#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
[GeneratedRegex(DisableRegexPattern)]
private static partial Regex GetDisableRegexPattern();
#else
Expand Down
6 changes: 6 additions & 0 deletions src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

* Removes `net7.0` target as .NET 7.0 is out
of support. The package keeps `netstandard2.1` target, so it
can still be used with .NET7.0 apps.
Adds `net8.0` target.
([#2038](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/2038))

## 1.9.2

Released 2024-Aug-12
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType</Target>
<Left>lib/net7.0/OpenTelemetry.Exporter.OneCollector.dll</Left>
<Right>lib/net6.0/OpenTelemetry.Exporter.OneCollector.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
</Suppressions>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public IDisposable Add(T callback)

lock (this.lockObject)
{
#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
ObjectDisposedException.ThrowIf(this.disposed, nameof(CallbackManager<T>));
#else
if (this.disposed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace OpenTelemetry.Exporter.OneCollector;

internal readonly struct BatchSerializationResult
{
#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
public required int NumberOfItemsSerialized { get; init; }

public required int NumberOfItemsDropped { get; init; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static void SerializeValueToJson(object? value, Utf8JsonWriter writer)
writer.WriteStringValue(v);
return;

#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
case DateOnly v:
JsonMetadataServices.DateOnlyConverter.Write(writer, v, null!);
return;
Expand All @@ -111,7 +111,7 @@ public static void SerializeValueToJson(object? value, Utf8JsonWriter writer)
JsonMetadataServices.TimeSpanConverter.Write(writer, v, null!);
return;

#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
case TimeOnly v:
JsonMetadataServices.TimeOnlyConverter.Write(writer, v, null!);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ internal readonly struct TransportSendRequest
{
public TransportSendRequest()
{
#if !NET7_0_OR_GREATER
#if !NET8_0_OR_GREATER
// Note: This is needed because < NET7 doesn't understand required.
this.ItemType = string.Empty;
this.ItemStream = default!;
#endif
}

#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
public required string ItemType { get; init; }

public required OneCollectorExporterSerializationFormatType ItemSerializationFormat { get; init; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

namespace OpenTelemetry.Exporter.OneCollector;

Expand Down Expand Up @@ -41,8 +43,10 @@ public OneCollectorExporterValidationException(string message, Exception? innerE
{
}

#if !NET8_0_OR_GREATER
private OneCollectorExporterValidationException(SerializationInfo serializationInfo, StreamingContext streamingContext)
: base(serializationInfo, streamingContext)
{
}
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Description>An OpenTelemetry .NET exporter that sends telemetry to Microsoft OneCollector</Description>
<Authors>OpenTelemetry Authors</Authors>
<TargetFrameworks>net7.0;net6.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
<MinVerTagPrefix>Exporter.OneCollector-</MinVerTagPrefix>
<EnableConfigurationBindingGenerator>true</EnableConfigurationBindingGenerator>
Expand All @@ -24,7 +24,7 @@

<ItemGroup>
<PackageReference Include="OpenTelemetry" Version="$(OTelSdkVersion)" />
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonPkgVer)" Condition="'$(TargetFramework)' != 'net7.0' AND '$(TargetFramework)' != 'net6.0'" />
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonPkgVer)" Condition="'$(TargetFramework)' != 'net8.0' AND '$(TargetFramework)' != 'net6.0'" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="$(MicrosoftExtensionsConfigurationBinderPkgVer)" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>net7.0;net6.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Description>OpenTelemetry .NET SDK telemetry enrichment.</Description>
<NoWarn>$(NoWarn),CS1591</NoWarn>
Expand Down
5 changes: 5 additions & 0 deletions src/OpenTelemetry.Extensions/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

* Removes `net7.0` target as .NET 7.0 is out
of support. The package keeps `netstandard2.0` target, so it
can still be used with .NET7.0 apps.
Kielek marked this conversation as resolved.
Show resolved Hide resolved
([#2038](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/2038))

* Update BaggageActivityProcessor to require baggage key predicate.
([#1816](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1816))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;netstandard2.0</TargetFrameworks>
<Description>ASP.NET Core instrumentation for OpenTelemetry .NET</Description>
<PackageTags>$(PackageTags);distributed-tracing;AspNetCore</PackageTags>
<MinVerTagPrefix>Instrumentation.AspNetCore-</MinVerTagPrefix>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttp)" Condition="'$(TargetFramework)' != 'net6.0' AND '$(TargetFramework)' != 'net7.0'" />
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttp)" Condition="'$(TargetFramework)' != 'net6.0' AND '$(TargetFramework)' != 'net8.0'" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<OutputType>Exe</OutputType>
<Description>Benchmark project for OpenTelemetry .NET OneCollectorExporter.</Description>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>$(SupportedNetTargets)</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);net48;net472;net471;net47;net462</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="$(BenchmarkDotNetPkgVer)" />
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttp)" Condition="'$(TargetFramework)' != 'net6.0' AND '$(TargetFramework)' != 'net7.0'" />
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttp)" Condition="'$(TargetFramework)' != 'net6.0' AND '$(TargetFramework)' != 'net8.0'" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void SerializeComplexValueToJsonTest()
this.SerializeValueToJsonTest(typeWithISpanFormattableOverflow, "\"Overflow\"");
#endif

#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
var dateOnly = DateOnly.FromDateTime(dt);
this.SerializeValueToJsonTest(dateOnly, $"\"{dateOnly:O}\"");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttp)" Condition="'$(TargetFramework)' != 'net6.0' AND '$(TargetFramework)' != 'net7.0'" />
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttp)" Condition="'$(TargetFramework)' != 'net6.0' AND '$(TargetFramework)' != 'net8.0'" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ public async Task ActivitiesStartedInMiddlewareBySettingHostActivityToNullShould
Assert.Equal("Microsoft.AspNetCore.Hosting.HttpRequestIn", aspnetcoreframeworkactivity.OperationName);
}

#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
[Fact]
public async Task UserRegisteredActivitySourceIsUsedForActivityCreationByAspNetCore()
{
Expand Down Expand Up @@ -1150,7 +1150,7 @@ private static void WaitForActivityExport(List<Activity> exportedItems, int coun
private static void ValidateAspNetCoreActivity(Activity activityToValidate, string expectedHttpPath)
{
Assert.Equal(ActivityKind.Server, activityToValidate.Kind);
#if NET7_0_OR_GREATER
#if NET8_0_OR_GREATER
Assert.Equal(HttpInListener.AspNetCoreActivitySourceName, activityToValidate.Source.Name);
Assert.NotNull(activityToValidate.Source.Version);
Assert.Empty(activityToValidate.Source.Version);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Unit test project for OpenTelemetry ASP.NET Core instrumentation</Description>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>$(SupportedNetTargets)</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'" >
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.33" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.33"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'" >
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.20" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.20"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'" >
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.8"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ each test case. These files are source-controlled, so if the behavior of the
instrumentation changes, the README files will be updated to reflect the change.

* [.NET 6](./README.net6.0.md)
* [.NET 7](./README.net7.0.md)
* [.NET 8](./README.net8.0.md)

For each test case a request is made to an ASP.NET Core application with a
Expand Down
Loading
Loading