Skip to content

Commit

Permalink
refactor(instrumentation-http): migrate away from getEnv() (#5469)
Browse files Browse the repository at this point in the history
  • Loading branch information
pichlermarc authored Feb 17, 2025
1 parent 5c90aec commit 52d0331
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ All notable changes to experimental packages in this project will be documented
* refactor(exporter-prometheus): remove unnecessary isNaN() check [#5377](https://github.com/open-telemetry/opentelemetry-js/pull/5377) @cjihrig
* refactor(sdk-node): move code to auto-instantiate propagators into utils [#5355](https://github.com/open-telemetry/opentelemetry-js/pull/5355) @pichlermarc
* chore: unpin `@opentelemetry/semantic-conventions` dep to allow better de-duplication in installs [#5439](https://github.com/open-telemetry/opentelemetry-js/pull/5439) @trentm
* refactor(instrumentation-http): migrate away from getEnv() [#5469](https://github.com/open-telemetry/opentelemetry-js/pull/5469) @pichlermarc
* refactor(sdk-node): migrate away from getEnv() [#5475](https://github.com/open-telemetry/opentelemetry-js/pull/5475) @pichlermarc

## 0.57.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ import {
ValueType,
} from '@opentelemetry/api';
import {
getStringListFromEnv,
hrTime,
hrTimeDuration,
hrTimeToMilliseconds,
suppressTracing,
RPCMetadata,
RPCType,
setRPCMetadata,
} from '@opentelemetry/core';
import type * as http from 'http';
import type * as https from 'https';
Expand All @@ -46,12 +50,6 @@ import {
InstrumentationNodeModuleDefinition,
safeExecuteInTheMiddle,
} from '@opentelemetry/instrumentation';
import {
RPCMetadata,
RPCType,
setRPCMetadata,
getEnv,
} from '@opentelemetry/core';
import { errorMonitor } from 'events';
import {
ATTR_HTTP_REQUEST_METHOD,
Expand Down Expand Up @@ -108,7 +106,8 @@ export class HttpInstrumentation extends InstrumentationBase<HttpInstrumentation
super('@opentelemetry/instrumentation-http', VERSION, config);
this._headerCapture = this._createHeaderCapture();

for (const entry of getEnv().OTEL_SEMCONV_STABILITY_OPT_IN) {
for (const entry of getStringListFromEnv('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;
Expand Down

0 comments on commit 52d0331

Please sign in to comment.