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

This commit is contained in:
Omar Hassane 2024-11-11 23:36:41 -05:00 committed by GitHub
parent 8483b68f2d
commit f1ef5960ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -50,6 +50,8 @@ All notable changes to experimental packages in this project will be documented
### :bug: (Bug Fix)
* fix(instrumentation-http): Fix the `OTEL_SEMCONV_STABILITY_OPT_IN` variable check. Using `of` instead of `in` [#5137](https://github.com/open-telemetry/opentelemetry-js/pull/5137)
* fix(instrumentation-http): drop url.parse in favor of URL constructor [#5091](https://github.com/open-telemetry/opentelemetry-js/pull/5091) @pichlermarc
* fixes a bug where using cyrillic characters in a client request string URL would throw an exception, whereas an un-instrumented client would accept the same input without throwing an exception

View File

@ -109,7 +109,7 @@ export class HttpInstrumentation extends InstrumentationBase<HttpInstrumentation
super('@opentelemetry/instrumentation-http', VERSION, config);
this._headerCapture = this._createHeaderCapture();
for (const entry in getEnv().OTEL_SEMCONV_STABILITY_OPT_IN) {
for (const entry of getEnv().OTEL_SEMCONV_STABILITY_OPT_IN) {
if (entry.toLowerCase() === 'http/dup') {
// http/dup takes highest precedence. If it is found, there is no need to read the rest of the list
this._semconvStability = SemconvStability.DUPLICATE;