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

[Exporter.Geneva] Remove .NET 6 target #2117

Merged
merged 7 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
19 changes: 19 additions & 0 deletions src/OpenTelemetry.Exporter.Geneva/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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.Geneva.EventNameExportMode</Target>
<Left>lib/net6.0/OpenTelemetry.Exporter.Geneva.dll</Left>
<Right>lib/netstandard2.0/OpenTelemetry.Exporter.Geneva.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:OpenTelemetry.Exporter.Geneva.ExceptionStackExportMode</Target>
<Left>lib/net6.0/OpenTelemetry.Exporter.Geneva.dll</Left>
<Right>lib/netstandard2.0/OpenTelemetry.Exporter.Geneva.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
</Suppressions>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#nullable enable

#if NET8_0_OR_GREATER
#if NET
using System.Collections.Frozen;
#endif

Expand Down Expand Up @@ -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<string, string> V40_PART_A_MAPPING = PART_A_MAPPING_DICTIONARY.ToFrozenDictionary();
#else
internal static readonly IReadOnlyDictionary<string, string> V40_PART_A_MAPPING = PART_A_MAPPING_DICTIONARY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#nullable enable

#if NET8_0_OR_GREATER
#if NET
using System.Collections.Frozen;
#endif
using System.Diagnostics;
Expand Down Expand Up @@ -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<string>? customFields;
private readonly FrozenDictionary<string, object>? prepopulatedFields;
#else
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#nullable enable

#if NET8_0_OR_GREATER
#if NET
using System.Collections.Frozen;
#endif
using System.Diagnostics;
Expand Down Expand Up @@ -34,15 +34,15 @@ internal sealed class MsgPackTraceExporter : MsgPackExporter, IDisposable
["messaging.url"] = "messagingUrl",
};

#if NET8_0_OR_GREATER
#if NET
internal static readonly FrozenDictionary<string, string> CS40_PART_B_MAPPING = CS40_PART_B_MAPPING_DICTIONARY.ToFrozenDictionary();
#else
internal static readonly Dictionary<string, string> CS40_PART_B_MAPPING = CS40_PART_B_MAPPING_DICTIONARY;
#endif

internal readonly ThreadLocal<byte[]> Buffer = new();

#if NET8_0_OR_GREATER
#if NET
internal readonly FrozenSet<string>? CustomFields;

internal readonly FrozenSet<string>? DedicatedFields;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project=".\Common.GenevaExporter.props"/>

<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>net8.0;$(NetStandardMinimumSupportedVersion)</TargetFrameworks>
CodeBlanch marked this conversation as resolved.
Show resolved Hide resolved
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Description>An OpenTelemetry .NET exporter that exports to local ETW or UDS</Description>
<Authors>OpenTelemetry Authors</Authors>
<Description>An OpenTelemetry .NET exporter that exports to local ETW or UDS.</Description>
<!-- Tweak style rules for Geneva: Allow underscores in constant names and allow regions inside code blocks -->
<NoWarn>$(NoWarn);SA1123;SA1310</NoWarn>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>net8.0;net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
<MinVerTagPrefix>Exporter.Geneva-</MinVerTagPrefix>
<PackageValidationBaselineVersion>1.9.0</PackageValidationBaselineVersion>
<Nullable>disable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>$(SupportedNetTargets)</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);net48;net472;net471;net47;net462</TargetFrameworks>
<NoWarn>$(NoWarn),SA1308,SA1201</NoWarn>
<OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);SA1308;SA1201</NoWarn>
<Nullable>disable</Nullable>
</PropertyGroup>

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

<Import Project="$(RepoRoot)\src\OpenTelemetry.Exporter.Geneva\Common.GenevaExporter.props" />

<PropertyGroup>
<Description>Unit test project for Geneva Exporters for OpenTelemetry</Description>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>$(SupportedNetTargets)</TargetFrameworks>
joegoldman2 marked this conversation as resolved.
Show resolved Hide resolved
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);net48;net472;net471;net47;net462</TargetFrameworks>
<NoWarn>$(NoWarn),SA1311,SA1312,SA1313,SA1123,SA1202,OTEL1002</NoWarn>
<Description>Unit test project for Geneva Exporters for OpenTelemetry.</Description>
<NoWarn>$(NoWarn);SA1311;SA1312;SA1313;SA1123;SA1202;OTEL1002</NoWarn>
<Nullable>disable</Nullable>
</PropertyGroup>

Expand Down
Loading