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 d70a0c5
Show file tree
Hide file tree
Showing 5 changed files with 25 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
11 changes: 10 additions & 1 deletion src/Shared/AWS/AWSSemanticConventions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#pragma warning disable SA1201
#pragma warning disable SA1623

// disable obsolete warning - remove in RC
#pragma warning disable CS0618

namespace OpenTelemetry.AWS;

/// <summary>
Expand Down Expand Up @@ -66,7 +69,10 @@ 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 = SemanticConventionVersion.Legacy;

// RC Release: change to
//SemanticConventionVersion.V1_28_0;

private readonly SemanticConventionVersion semanticConventionVersion;

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

case SemanticConventionVersion.Legacy:
return new AWSSemanticConventionsLegacy();

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 d70a0c5

Please sign in to comment.