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

fix(instrumentation-http): iterating through the OTEL_SEMCONV_STABILITY_OPT_IN content instead of the entry indices #5137

Conversation

omarHassane
Copy link
Contributor

@omarHassane omarHassane commented Nov 11, 2024

Which problem is this PR solving?

Issue: Setting the OTEL_SEMCONV_STABILITY_OPT_IN environment variable doesn't do anything.
Bug: In the http.ts line 112 the for loop iterates through getEnv().OTEL_SEMCONV_STABILITY_OPT_IN but the since it's using in the value of entry would be the indice of the element in the array (0,1,..) not the value.
Fix: Using of instead iterates over the values themselves.

Please see https://www.typescriptlang.org/docs/handbook/iterators-and-generators.html#forof-vs-forin-statements for more information about the use of in vs of

Short description of the changes

Issue: Setting the OTEL_SEMCONV_STABILITY_OPT_IN environment variable doesn't do anything.
Bug: In the http.ts line 112 the for loop iterates through getEnv().OTEL_SEMCONV_STABILITY_OPT_IN but the since it's using in the value of entry would be the indice of the element in the array (0,1,..) not the value.
Fix: Using of instead iterates over the values themselves.

Please see https://www.typescriptlang.org/docs/handbook/iterators-and-generators.html#forof-vs-forin-statements for more information about the use of in vs of

Issue

related issue #5103

Type of change

Bug fix

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@omarHassane omarHassane requested a review from a team as a code owner November 11, 2024 22:09
Copy link

linux-foundation-easycla bot commented Nov 11, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@omarHassane omarHassane changed the title fix: iterating through the OTEL_SEMCONV_STABILITY_OPT_IN content instead of the entry indices fix(instrumentation-http): iterating through the OTEL_SEMCONV_STABILITY_OPT_IN content instead of the entry indices Nov 11, 2024
Copy link
Member

@dyladan dyladan left a comment

Choose a reason for hiding this comment

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

🤦 that was my fault

@dyladan
Copy link
Member

dyladan commented Nov 11, 2024

Please add an entry to the changelog

Copy link

codecov bot commented Nov 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.21%. Comparing base (8483b68) to head (bd9154b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5137      +/-   ##
==========================================
- Coverage   93.23%   93.21%   -0.02%     
==========================================
  Files         315      315              
  Lines        8096     8096              
  Branches     1622     1622              
==========================================
- Hits         7548     7547       -1     
- Misses        548      549       +1     

see 1 file with indirect coverage changes

@omarHassane
Copy link
Contributor Author

Please add an entry to the changelog

@dyladan done ✅

@dyladan dyladan added this pull request to the merge queue Nov 12, 2024
Merged via the queue into open-telemetry:main with commit f1ef596 Nov 12, 2024
21 checks passed
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.

2 participants