Skip to content

Commit

Permalink
change strategy - beta version will default to Legacy (ie no change i…
Browse files Browse the repository at this point in the history
…n semantic convention output). There will be a fast follow PR to remove Legacy in preparation for an RC.
  • Loading branch information
ppittle committed Dec 19, 2024
1 parent 189e873 commit 7f11f07
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#nullable enable
OpenTelemetry.Instrumentation.AWS.SemanticConventionVersion
OpenTelemetry.Instrumentation.AWS.SemanticConventionVersion.Legacy = -1 -> OpenTelemetry.Instrumentation.AWS.SemanticConventionVersion
OpenTelemetry.Instrumentation.AWS.SemanticConventionVersion.Latest = 0 -> OpenTelemetry.Instrumentation.AWS.SemanticConventionVersion
OpenTelemetry.Instrumentation.AWS.SemanticConventionVersion.V1_29_0 = 2 -> OpenTelemetry.Instrumentation.AWS.SemanticConventionVersion
OpenTelemetry.Instrumentation.AWS.SemanticConventionVersion.V1_28_0 = 1 -> OpenTelemetry.Instrumentation.AWS.SemanticConventionVersion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#nullable enable
OpenTelemetry.Instrumentation.AWSLambda.SemanticConventionVersion.Legacy = -1 -> OpenTelemetry.Instrumentation.AWSLambda.SemanticConventionVersion
OpenTelemetry.Instrumentation.AWSLambda.SemanticConventionVersion
OpenTelemetry.Instrumentation.AWSLambda.SemanticConventionVersion.Latest = 0 -> OpenTelemetry.Instrumentation.AWSLambda.SemanticConventionVersion
OpenTelemetry.Instrumentation.AWSLambda.SemanticConventionVersion.V1_29_0 = 2 -> OpenTelemetry.Instrumentation.AWSLambda.SemanticConventionVersion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
OpenTelemetry.Resources.AWS.SemanticConventionVersion
OpenTelemetry.Resources.AWS.SemanticConventionVersion.Legacy = -1 -> OpenTelemetry.Resources.AWS.SemanticConventionVersion
OpenTelemetry.Resources.AWS.SemanticConventionVersion.Latest = 0 -> OpenTelemetry.Resources.AWS.SemanticConventionVersion
OpenTelemetry.Resources.AWS.SemanticConventionVersion.V1_29_0 = 2 -> OpenTelemetry.Resources.AWS.SemanticConventionVersion
OpenTelemetry.Resources.AWS.SemanticConventionVersion.V1_28_0 = 1 -> OpenTelemetry.Resources.AWS.SemanticConventionVersion
Expand Down
14 changes: 13 additions & 1 deletion src/Shared/AWS/AWSSemanticConventions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ internal partial class AWSSemanticConventions
/// Per SemanticConventionVersion, default should stay as
/// <see cref="SemanticConventionVersion.V1_28_0"/> until next major version bump.
/// </remarks>
internal const SemanticConventionVersion DefaultSemanticConventionVersion = SemanticConventionVersion.V1_28_0;
internal const SemanticConventionVersion DefaultSemanticConventionVersion =
#pragma warning disable CS0618 // Type or member is obsolete
// Beta Release
SemanticConventionVersion.Legacy;
#pragma warning restore CS0618 // Type or member is obsolete
// RC Release
//SemanticConventionVersion.V1_28_0;

private readonly SemanticConventionVersion semanticConventionVersion;

Expand Down Expand Up @@ -488,6 +494,12 @@ private AWSSemanticConventionsBase GetSemanticConventionVersion()
case SemanticConventionVersion.V1_28_0:
return new AWSSemanticConventions_V1_28_0();

#pragma warning disable CS0618 // Type or member is obsolete
// For Beta Release only - remove in RC
case SemanticConventionVersion.Legacy:
return new AWSSemanticConventionsLegacy();
#pragma warning restore CS0618 // Type or member is obsolete

default:
throw new InvalidEnumArgumentException(
argumentName: nameof(SemanticConventionVersion),
Expand Down
12 changes: 12 additions & 0 deletions src/Shared/AWS/SemanticConventionVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ public enum SemanticConventionVersion
/// </summary>
Latest = 0,

/// <summary>
/// Represents the mixture of Semantic Conventions used in OpenTelemetry.*.AWS libraries
/// in 1.10.0-beta.x.
/// <para />
/// This allows users to upgrade to the latest beta nuget package without experiencing a change in
/// Semantic Convention output. Then there is an opportunity for users to trial <see cref="V1_28_0"/>.
/// <para />
/// This option will be REMOVED in the next Release Candidate.
/// </summary>
[Obsolete("This will be removed in the 1.10.0-RC", error: false)]
Legacy = -1,

/// <summary>
/// Pin to the specific state of all Semantic Conventions as of the 1.28.0
/// release. See:
Expand Down

0 comments on commit 7f11f07

Please sign in to comment.