From 2785931e2b752c13038f4c37b6665217ae7edb20 Mon Sep 17 00:00:00 2001 From: joegoldman2 <147369450+joegoldman@users.noreply.github.com> Date: Sat, 28 Sep 2024 13:52:37 +0000 Subject: [PATCH 1/6] [geneva] Remove .NET 6 target --- .../Internal/MsgPack/MsgPackExporter.cs | 4 ++-- .../Internal/MsgPack/MsgPackLogExporter.cs | 8 ++++---- .../Internal/MsgPack/MsgPackTraceExporter.cs | 10 +++++----- .../Internal/Tld/UncheckedASCIIEncoding.cs | 4 ++-- .../Metrics/GenevaMetricExporter.cs | 2 +- .../OpenTelemetry.Exporter.Geneva.csproj | 10 +++++----- .../OpenTelemetry.Exporter.Geneva.Stress.csproj | 6 +++--- .../OpenTelemetry.Exporter.Geneva.Tests.csproj | 7 ++++--- 8 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/OpenTelemetry.Exporter.Geneva/Internal/MsgPack/MsgPackExporter.cs b/src/OpenTelemetry.Exporter.Geneva/Internal/MsgPack/MsgPackExporter.cs index c37581d5e3..3d7bb7def1 100644 --- a/src/OpenTelemetry.Exporter.Geneva/Internal/MsgPack/MsgPackExporter.cs +++ b/src/OpenTelemetry.Exporter.Geneva/Internal/MsgPack/MsgPackExporter.cs @@ -3,7 +3,7 @@ #nullable enable -#if NET8_0_OR_GREATER +#if NET using System.Collections.Frozen; #endif @@ -33,7 +33,7 @@ internal abstract class MsgPackExporter [Schema.V40.PartA.Extensions.Os.Ver] = "env_os_ver", }; -#if NET8_0_OR_GREATER +#if NET internal static readonly IReadOnlyDictionary V40_PART_A_MAPPING = PART_A_MAPPING_DICTIONARY.ToFrozenDictionary(); #else internal static readonly IReadOnlyDictionary V40_PART_A_MAPPING = PART_A_MAPPING_DICTIONARY; diff --git a/src/OpenTelemetry.Exporter.Geneva/Internal/MsgPack/MsgPackLogExporter.cs b/src/OpenTelemetry.Exporter.Geneva/Internal/MsgPack/MsgPackLogExporter.cs index 6e00b6a723..4371d7d373 100644 --- a/src/OpenTelemetry.Exporter.Geneva/Internal/MsgPack/MsgPackLogExporter.cs +++ b/src/OpenTelemetry.Exporter.Geneva/Internal/MsgPack/MsgPackLogExporter.cs @@ -3,7 +3,7 @@ #nullable enable -#if NET8_0_OR_GREATER +#if NET using System.Collections.Frozen; #endif using System.Diagnostics; @@ -33,7 +33,7 @@ internal sealed class MsgPackLogExporter : MsgPackExporter, IDisposable private readonly bool shouldExportEventName; private readonly TableNameSerializer tableNameSerializer; -#if NET8_0_OR_GREATER +#if NET private readonly FrozenSet? customFields; private readonly FrozenDictionary? prepopulatedFields; #else @@ -94,7 +94,7 @@ public MsgPackLogExporter(GenevaExporterOptions options) this.prepopulatedFieldKeys.Add(kv.Key); } -#if NET8_0_OR_GREATER +#if NET this.prepopulatedFields = tempPrepopulatedFields.ToFrozenDictionary(StringComparer.Ordinal); #else this.prepopulatedFields = tempPrepopulatedFields; @@ -110,7 +110,7 @@ public MsgPackLogExporter(GenevaExporterOptions options) customFields.Add(name); } -#if NET8_0_OR_GREATER +#if NET this.customFields = customFields.ToFrozenSet(StringComparer.Ordinal); #else this.customFields = customFields; diff --git a/src/OpenTelemetry.Exporter.Geneva/Internal/MsgPack/MsgPackTraceExporter.cs b/src/OpenTelemetry.Exporter.Geneva/Internal/MsgPack/MsgPackTraceExporter.cs index 2778de0bfd..9c0d15beef 100644 --- a/src/OpenTelemetry.Exporter.Geneva/Internal/MsgPack/MsgPackTraceExporter.cs +++ b/src/OpenTelemetry.Exporter.Geneva/Internal/MsgPack/MsgPackTraceExporter.cs @@ -3,7 +3,7 @@ #nullable enable -#if NET8_0_OR_GREATER +#if NET using System.Collections.Frozen; #endif using System.Diagnostics; @@ -34,7 +34,7 @@ internal sealed class MsgPackTraceExporter : MsgPackExporter, IDisposable ["messaging.url"] = "messagingUrl", }; -#if NET8_0_OR_GREATER +#if NET internal static readonly FrozenDictionary CS40_PART_B_MAPPING = CS40_PART_B_MAPPING_DICTIONARY.ToFrozenDictionary(); #else internal static readonly Dictionary CS40_PART_B_MAPPING = CS40_PART_B_MAPPING_DICTIONARY; @@ -42,7 +42,7 @@ internal sealed class MsgPackTraceExporter : MsgPackExporter, IDisposable internal readonly ThreadLocal Buffer = new(); -#if NET8_0_OR_GREATER +#if NET internal readonly FrozenSet? CustomFields; internal readonly FrozenSet? DedicatedFields; @@ -123,7 +123,7 @@ public MsgPackTraceExporter(GenevaExporterOptions options) dedicatedFields.Add(name); } -#if NET8_0_OR_GREATER +#if NET this.CustomFields = customFields.ToFrozenSet(StringComparer.Ordinal); #else this.CustomFields = customFields; @@ -137,7 +137,7 @@ public MsgPackTraceExporter(GenevaExporterOptions options) dedicatedFields.Add("otel.status_code"); dedicatedFields.Add("otel.status_description"); -#if NET8_0_OR_GREATER +#if NET this.DedicatedFields = dedicatedFields.ToFrozenSet(StringComparer.Ordinal); #else this.DedicatedFields = dedicatedFields; diff --git a/src/OpenTelemetry.Exporter.Geneva/Internal/Tld/UncheckedASCIIEncoding.cs b/src/OpenTelemetry.Exporter.Geneva/Internal/Tld/UncheckedASCIIEncoding.cs index aed31bd1b1..04085f22c2 100644 --- a/src/OpenTelemetry.Exporter.Geneva/Internal/Tld/UncheckedASCIIEncoding.cs +++ b/src/OpenTelemetry.Exporter.Geneva/Internal/Tld/UncheckedASCIIEncoding.cs @@ -83,7 +83,7 @@ public unsafe override int GetChars(byte[] bytes, int byteIndex, int byteCount, public override unsafe int GetBytes(char* charPtr, int charCount, byte* bytePtr, int byteCount) { -#if NET8_0_OR_GREATER +#if NET ArgumentOutOfRangeException.ThrowIfLessThan(byteCount, charCount); #else if (byteCount < charCount) @@ -102,7 +102,7 @@ public override unsafe int GetBytes(char* charPtr, int charCount, byte* bytePtr, public override unsafe int GetChars(byte* bytePtr, int byteCount, char* charPtr, int charCount) { -#if NET8_0_OR_GREATER +#if NET ArgumentOutOfRangeException.ThrowIfLessThan(charCount, byteCount); #else if (charCount < byteCount) diff --git a/src/OpenTelemetry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs b/src/OpenTelemetry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs index 253fbd9a63..ade4ff8593 100644 --- a/src/OpenTelemetry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs +++ b/src/OpenTelemetry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs @@ -116,7 +116,7 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } -#if NET8_0_OR_GREATER +#if NET [GeneratedRegex(DisableRegexPattern)] private static partial Regex GetDisableRegexPattern(); #else diff --git a/src/OpenTelemetry.Exporter.Geneva/OpenTelemetry.Exporter.Geneva.csproj b/src/OpenTelemetry.Exporter.Geneva/OpenTelemetry.Exporter.Geneva.csproj index 4605cafce6..8fb1cffd7a 100644 --- a/src/OpenTelemetry.Exporter.Geneva/OpenTelemetry.Exporter.Geneva.csproj +++ b/src/OpenTelemetry.Exporter.Geneva/OpenTelemetry.Exporter.Geneva.csproj @@ -1,15 +1,15 @@ + + + net8.0;$(NetStandardMinimumSupportedVersion) + $(TargetFrameworks);net462 true - An OpenTelemetry .NET exporter that exports to local ETW or UDS - OpenTelemetry Authors + An OpenTelemetry .NET exporter that exports to local ETW or UDS. $(NoWarn);SA1123;SA1310 - - net8.0;net6.0;netstandard2.0 - $(TargetFrameworks);net462 Exporter.Geneva- 1.9.0 disable diff --git a/test/OpenTelemetry.Exporter.Geneva.Stress/OpenTelemetry.Exporter.Geneva.Stress.csproj b/test/OpenTelemetry.Exporter.Geneva.Stress/OpenTelemetry.Exporter.Geneva.Stress.csproj index 00273f8729..a9cd3cffcf 100644 --- a/test/OpenTelemetry.Exporter.Geneva.Stress/OpenTelemetry.Exporter.Geneva.Stress.csproj +++ b/test/OpenTelemetry.Exporter.Geneva.Stress/OpenTelemetry.Exporter.Geneva.Stress.csproj @@ -1,11 +1,11 @@ - Exe - $(SupportedNetTargets) + net8.0 $(TargetFrameworks);net48;net472;net471;net47;net462 - $(NoWarn),SA1308,SA1201 + Exe + $(NoWarn);SA1308;SA1201 disable diff --git a/test/OpenTelemetry.Exporter.Geneva.Tests/OpenTelemetry.Exporter.Geneva.Tests.csproj b/test/OpenTelemetry.Exporter.Geneva.Tests/OpenTelemetry.Exporter.Geneva.Tests.csproj index 040ef19fa6..8f3e724c44 100644 --- a/test/OpenTelemetry.Exporter.Geneva.Tests/OpenTelemetry.Exporter.Geneva.Tests.csproj +++ b/test/OpenTelemetry.Exporter.Geneva.Tests/OpenTelemetry.Exporter.Geneva.Tests.csproj @@ -1,12 +1,13 @@ + - Unit test project for Geneva Exporters for OpenTelemetry - $(SupportedNetTargets) + net8.0 $(TargetFrameworks);net48;net472;net471;net47;net462 - $(NoWarn),SA1311,SA1312,SA1313,SA1123,SA1202,OTEL1002 + Unit test project for Geneva Exporters for OpenTelemetry. + $(NoWarn);SA1311;SA1312;SA1313;SA1123;SA1202;OTEL1002 disable From 8996afdfe08f70301f9b36d8cbc4a591736a639d Mon Sep 17 00:00:00 2001 From: joegoldman2 <147369450+joegoldman@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:45:03 +0000 Subject: [PATCH 2/6] Add CompatibilitySuppressions.xml --- .../CompatibilitySuppressions.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml diff --git a/src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml b/src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..ce1c14c78c --- /dev/null +++ b/src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml @@ -0,0 +1,18 @@ + + + + + CP0008 + T:OpenTelemetry.Exporter.Geneva.EventNameExportMode + lib/net6.0/OpenTelemetry.Exporter.Geneva.dll + lib/netstandard2.0/OpenTelemetry.Exporter.Geneva.dll + true + + + CP0008 + T:OpenTelemetry.Exporter.Geneva.ExceptionStackExportMode + lib/net6.0/OpenTelemetry.Exporter.Geneva.dll + lib/netstandard2.0/OpenTelemetry.Exporter.Geneva.dll + true + + From d7eb3f2278920e8584bf404a17f6e37f7b4bc607 Mon Sep 17 00:00:00 2001 From: joegoldman2 <147369450+joegoldman@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:53:10 +0000 Subject: [PATCH 3/6] Update CompatibilitySuppressions.xml --- src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml b/src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml index ce1c14c78c..8d9a791782 100644 --- a/src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml +++ b/src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml @@ -1,4 +1,4 @@ - + From 1524b767edc7dafdd3ee967068d49fcd35f17bf7 Mon Sep 17 00:00:00 2001 From: joegoldman2 <147369450+joegoldman@users.noreply.github.com> Date: Sat, 28 Sep 2024 16:00:56 +0000 Subject: [PATCH 4/6] Update CompatibilitySuppressions.xml --- .../CompatibilitySuppressions.xml | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml b/src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml index 8d9a791782..61ae99654f 100644 --- a/src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml +++ b/src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml @@ -1,18 +1,19 @@ - - - CP0008 - T:OpenTelemetry.Exporter.Geneva.EventNameExportMode - lib/net6.0/OpenTelemetry.Exporter.Geneva.dll - lib/netstandard2.0/OpenTelemetry.Exporter.Geneva.dll - true - - - CP0008 - T:OpenTelemetry.Exporter.Geneva.ExceptionStackExportMode - lib/net6.0/OpenTelemetry.Exporter.Geneva.dll - lib/netstandard2.0/OpenTelemetry.Exporter.Geneva.dll - true - + + + CP0008 + T:OpenTelemetry.Exporter.Geneva.EventNameExportMode + lib/net6.0/OpenTelemetry.Exporter.Geneva.dll + lib/netstandard2.0/OpenTelemetry.Exporter.Geneva.dll + true + + + CP0008 + T:OpenTelemetry.Exporter.Geneva.ExceptionStackExportMode + lib/net6.0/OpenTelemetry.Exporter.Geneva.dll + lib/netstandard2.0/OpenTelemetry.Exporter.Geneva.dll + true + From 686fdb17b34887e8b1884874a938dd5be2c72c73 Mon Sep 17 00:00:00 2001 From: joegoldman2 <147369450+joegoldman@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:50:39 +0000 Subject: [PATCH 5/6] Add changelog entry --- src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md b/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md index 631613a201..b5b82462ed 100644 --- a/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +* Drop support for .NET 7 as this target is no longer supported. + ([#2117](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2117)) + ## 1.9.0 Released 2024-Jun-21 From 7111a2f5c4f55da5874e6dd66ee0cd66a0c65397 Mon Sep 17 00:00:00 2001 From: joegoldman2 <147369450+joegoldman@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:52:09 +0000 Subject: [PATCH 6/6] Update changelog --- src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md b/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md index b5b82462ed..47b1b1f495 100644 --- a/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -* Drop support for .NET 7 as this target is no longer supported. +* Drop support for .NET 6 as this target is no longer supported. ([#2117](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2117)) ## 1.9.0