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

Add Support for HttpSemanticConvention breaking changes. #4504

Merged
merged 9 commits into from
May 24, 2023
Merged

Add Support for HttpSemanticConvention breaking changes. #4504

merged 9 commits into from
May 24, 2023

Conversation

TimothyMothra
Copy link
Contributor

Design discussion issue #4484

Http Semantic Convention is introducing breaking changes.
This PR introduces a new helper class to read and parse the new environment variable.

During startup, an instrumentation library should check for an environment variable.
Based on the parsed value, that library will either emit the old attributes, new attributes, or both.

Changes

  • Add Helper class to parse environment variable
  • Add enum to represent Semantic Convention decision.
  • Add unit tests to validate Parser and Enum Flags.
  • Update HttpInListener ctor in Instrumentation.AspNetCore

Please provide a brief description of the changes here.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (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)

@TimothyMothra TimothyMothra requested a review from a team May 18, 2023 00:54
@TimothyMothra
Copy link
Contributor Author

@vishweshbankwar please review

@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #4504 (637c9bd) into main (f4f4469) will increase coverage by 0.01%.
The diff coverage is 81.81%.

❗ Current head 637c9bd differs from pull request most recent head 4ca4063. Consider uploading reports for the commit 4ca4063 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4504      +/-   ##
==========================================
+ Coverage   85.16%   85.17%   +0.01%     
==========================================
  Files         316      317       +1     
  Lines       12583    12594      +11     
==========================================
+ Hits        10716    10727      +11     
  Misses       1867     1867              
Impacted Files Coverage Δ
...metry.Api/Internal/HttpSemanticConventionHelper.cs 80.00% <80.00%> (ø)
...tation.AspNetCore/Implementation/HttpInListener.cs 90.18% <100.00%> (+0.06%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Member

@vishweshbankwar vishweshbankwar left a comment

Choose a reason for hiding this comment

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

LGTM

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.

LGTM, just one more minor thing

Comment on lines 17 to 18
namespace OpenTelemetry.Internal
{
Copy link
Member

Choose a reason for hiding this comment

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

just one more nit. use a file-scoped namespace here to reduce indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no problem!

any way to make this a code style rule for future PRs?

Copy link
Contributor

Choose a reason for hiding this comment

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

We should also update the existing classes to use file-scoped namespace for being consistent.

@utpilla utpilla merged commit 47d88e1 into open-telemetry:main May 24, 2023
@TimothyMothra TimothyMothra deleted the 4484_httpSemConv branch May 24, 2023 16:52
vitek-karas pushed a commit to vitek-karas/opentelemetry-dotnet that referenced this pull request May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants