File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
detectors/node/opentelemetry-resource-detector-aws/src/detectors Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ import * as http from 'http';
4848import * as util from 'util' ;
4949import * as fs from 'fs' ;
5050import * as os from 'os' ;
51- import { getEnv } from '@opentelemetry/core' ;
5251
5352const HTTP_TIMEOUT_IN_MS = 1000 ;
5453
@@ -77,8 +76,10 @@ export class AwsEcsDetectorSync implements DetectorSync {
7776 }
7877
7978 private async _getAttributes ( ) : Promise < ResourceAttributes > {
80- const env = getEnv ( ) ;
81- if ( ! env . ECS_CONTAINER_METADATA_URI_V4 && ! env . ECS_CONTAINER_METADATA_URI ) {
79+ if (
80+ ! process . env . ECS_CONTAINER_METADATA_URI_V4 &&
81+ ! process . env . ECS_CONTAINER_METADATA_URI
82+ ) {
8283 diag . debug ( 'AwsEcsDetector failed: Process is not on ECS' ) ;
8384 return { } ;
8485 }
@@ -89,7 +90,7 @@ export class AwsEcsDetectorSync implements DetectorSync {
8990 [ ATTR_CLOUD_PLATFORM ] : CLOUD_PLATFORM_VALUE_AWS_ECS ,
9091 } ) . merge ( await AwsEcsDetectorSync . _getContainerIdAndHostnameResource ( ) ) ;
9192
92- const metadataUrl = getEnv ( ) . ECS_CONTAINER_METADATA_URI_V4 ;
93+ const metadataUrl = process . env . ECS_CONTAINER_METADATA_URI_V4 ;
9394 if ( metadataUrl ) {
9495 const [ containerMetadata , taskMetadata ] = await Promise . all ( [
9596 AwsEcsDetectorSync . _getUrlAsJson ( metadataUrl ) ,
You can’t perform that action at this time.
0 commit comments