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

Upgrade Semantic Convention handling in AWS libraries. #2367

Merged
merged 35 commits into from
Dec 20, 2024

Conversation

ppittle
Copy link
Member

@ppittle ppittle commented Dec 6, 2024

Fixes #
Design discussion issue #

NOTE: This PR is built on top of #2363, #2363 should be merged first.

Updates 2

This PR will contain -no- change in Semantic Convention by default. Users can opt-in to SemanticConventionVersions.1.28, but default is SemanticConventionVersions.Legacy.

Once merged, this PR will be released as a beta - allowing users a non-breaking way to test opting in-to 1.28.

There will be a fast follow up PR that removes SemanticConventionVersions.Legacy and changes the default to SemanticConventionVersions.V1_28_0. That PR will be merged and released as a Release Candidate.

This follows the release strategy for other contrib packages that have made similar breaking changes around Semantic Convention stabilization.

Updates 1

  • The original design of having SemanticConventionVersions track the version of the OpenTelemetry.*.AWS Libraries has been scrapped in favor of tracking Semantic Convnetion repo release versions.
  • To simplify communications and development, all OpenTelemetry.*.AWS Libraries will be upgraded to use
    Semantic Convention 1.28.
  • To demonstrate how new Semantic Convention versions will be added in the future, this PR also includes Semantic Convention 1.29.
  • To promote stability for users, OpenTelemetry..AWS Libraries will default to Semantic Convnetion 1.28 until all conventions used by the libraries are stabalized. This means future versions of the OpenTelemetry..AWS Library will not change AWSSemanticConvention.DefaultSemanticConventionVersion
    • Users can opt-in to any version of Semantic Convention supported the current (or future) versions of OpenTelemetry.*.AWS Libraries.

Changes

Implementation of the design discussed in the Nov 26th OpenTelemetry .NET SIG meeting. This design allows releasing the AWS OTel Contrib libraries as GA while still informing users that underlying Semantic Conventions are experimental.

This is exposed via the SemanticConventionVersion enum:

/// <summary>
/// <para>
/// Collection of the Open Telemetry Semantic Conventions supported by the OpenTelemetry.*.AWS libraries.
/// Can be used to pin the version of Semantic Convention emitted.
/// </para>
/// <para>
/// While these libraries are intended for production use, they rely on several Semantic Conventions that are
/// still considered Experimental, meaning they may undergo additional changes before becoming Stable.  This can
/// impact the aggregation and analysis of telemetry signals in environments with multiple applications or microservices.
/// For example, a microservice using an older version of the Semantic Conventions for Http Attributes may emit
/// <c>"http.method"</c> with a value of GET,while a different microservice, using a new version of Semantic Convention may instead emit the GET as
/// <c>"http.request.method"</c>.
/// </para>
/// <para>
/// Future versions the OpenTelemetry.*.AWS libraries will include updates to the Semantic Convention, which may break compatibility with a previous version.
/// To opt-out of automatic upgrades, you can pin to a specific version:
/// <code>
/// <![CDATA[
///  using (var tracerProvider = Sdk.CreateTracerProviderBuilder()
///     .AddAWSLambdaConfigurations(opt =>
///     {
///         opt.SemanticConventionVersion = SemanticConventionVersion.v1_10_EXPERIMENTAL;
///     })
///     .Build()!)
/// ]]>
/// </code>
/// </para>
/// <para>
/// For additional details, see:
/// https://opentelemetry.io/docs/specs/otel/versioning-and-stability/.
/// </para>
/// </summary>
/// <remarks>
/// Once a Semantic Convention becomes Stable, OpenTelemetry.*.AWS libraries
/// will remain on that version until the next major version bump.
/// </remarks>
public enum SemanticConventionVersion
{
    /// <summary>
    /// Use Experimental Conventions until they become stable and then
    /// pin to stable.
    /// </summary>
    Latest = 0,

    /// <summary>
    /// Pin to the specific state of all Semantic Conventions as of the 1.28.0
    /// release. See:
    /// https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.28.0.
    /// </summary>
    V1_28_0_Experimental = 1,

    /// <summary>
    /// Pin to the specific state of all Semantic Conventions as of the 1.29.0
    /// release. See:
    /// https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.29.0.
    /// </summary>
    V1_29_0_Experimental = 2,
}

Users can choose how to handle this for their applications by either pinning to a specific Semantic Convention version or automatically getting updates the next time they upgrade the AWS Otel nuget packages.

Selection is made by updating the Options object in the builder method.

using (var tracerProvider = Sdk.CreateTracerProviderBuilder()
           .AddAWSLambdaConfigurations(opt =>
           {
               // Added in this PR
               opt.SemanticConventionVersion = SemanticConventionVersion.V1_29_0_Experimental;
           })
           .AddInMemoryExporter(exportedItems)
           .Build()!)

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@ppittle ppittle requested a review from a team as a code owner December 6, 2024 04:25
@github-actions github-actions bot added comp:extensions.aws Things related to OpenTelemetry.Extensions.AWS comp:instrumentation.aws Things related to OpenTelemetry.Instrumentation.AWS comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda comp:resources.aws Things related to OpenTelemetry.Resources.AWS labels Dec 6, 2024
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (71655ce) to head (8d75bfd).
Report is 664 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #2367       +/-   ##
==========================================
- Coverage   73.91%       0   -73.92%     
==========================================
  Files         267       0      -267     
  Lines        9615       0     -9615     
==========================================
- Hits         7107       0     -7107     
+ Misses       2508       0     -2508     

see 263 files with indirect coverage changes

@ppittle ppittle force-pushed the upgrade-aws-semantic-convention branch from da63599 to 3183104 Compare December 6, 2024 04:45
@ppittle ppittle force-pushed the upgrade-aws-semantic-convention branch from 3183104 to ddef75b Compare December 6, 2024 04:55
@github-actions github-actions bot removed the comp:extensions.aws Things related to OpenTelemetry.Extensions.AWS label Dec 6, 2024
@ppittle ppittle force-pushed the upgrade-aws-semantic-convention branch from ddef75b to f62eb8d Compare December 6, 2024 04:58
@ppittle ppittle force-pushed the upgrade-aws-semantic-convention branch from f62eb8d to 59b59f1 Compare December 6, 2024 05:11
@ppittle ppittle force-pushed the upgrade-aws-semantic-convention branch from 59b59f1 to ed49ef0 Compare December 6, 2024 06:19
@ppittle ppittle force-pushed the upgrade-aws-semantic-convention branch from ed49ef0 to 1dbdb19 Compare December 6, 2024 23:10
@ppittle ppittle force-pushed the upgrade-aws-semantic-convention branch from 2b9780c to 6c1f07a Compare December 19, 2024 22:36
@ppittle ppittle force-pushed the upgrade-aws-semantic-convention branch from 6c1f07a to 7118581 Compare December 19, 2024 22:42
@ppittle ppittle force-pushed the upgrade-aws-semantic-convention branch from 7118581 to 6164f19 Compare December 19, 2024 22:44
@ppittle ppittle force-pushed the upgrade-aws-semantic-convention branch from 6164f19 to 7f11f07 Compare December 19, 2024 23:01
@ppittle ppittle force-pushed the upgrade-aws-semantic-convention branch from 7f11f07 to 970d286 Compare December 19, 2024 23:14
…n semantic convention output). There will be a fast follow PR to remove Legacy in preparation for an RC.
@ppittle ppittle force-pushed the upgrade-aws-semantic-convention branch from 970d286 to d70a0c5 Compare December 19, 2024 23:29
Copy link
Member

@alanwest alanwest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed this PR at length with @ppittle today.

The plan is to release one more beta version of these instrumentations that supports the existing conventions they emit. By default the telemetry they emits does not change with this PR, but a user can now opt in to specific versions of the semantic conventions.

A release candidate will ship shortly after the last beta version. The release candidate will default to the new semantic conventions and remove support for the "legacy" conventions.

There are some active reviewers of this PR that have not had a opportunity to approve it yet (@Oberon00 and @Kielek). Since this PR should not be changing any behavior by default, I've decided to approve and merge it so that we can release the next beta version. @ppittle will open up the follow up PR in preparation of the release candidate soon. That should give folks the chance to weigh in with any additional feedback on this plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.aws Things related to OpenTelemetry.Instrumentation.AWS comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda comp:resources.aws Things related to OpenTelemetry.Resources.AWS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants