@@ -57,7 +57,7 @@ class GcpDetector implements ResourceDetector {
5757
5858 const attributes : DetectedResourceAttributes = {
5959 [ SEMRESATTRS_CLOUD_PROVIDER ] : ( async ( ) => {
60- return await isAvail ? CLOUDPROVIDERVALUES_GCP : undefined ;
60+ return ( await isAvail ) ? CLOUDPROVIDERVALUES_GCP : undefined ;
6161 } ) ( ) ,
6262 [ SEMRESATTRS_CLOUD_ACCOUNT_ID ] : this . _getProjectId ( isAvail ) ,
6363 [ SEMRESATTRS_HOST_ID ] : this . _getInstanceId ( isAvail ) ,
@@ -69,21 +69,23 @@ class GcpDetector implements ResourceDetector {
6969 if ( process . env . KUBERNETES_SERVICE_HOST ) {
7070 attributes [ SEMRESATTRS_K8S_CLUSTER_NAME ] = this . _getClusterName ( isAvail ) ;
7171 attributes [ SEMRESATTRS_K8S_NAMESPACE_NAME ] = ( async ( ) => {
72- return await isAvail ? process . env . NAMESPACE : undefined ;
72+ return ( await isAvail ) ? process . env . NAMESPACE : undefined ;
7373 } ) ( ) ;
7474 attributes [ SEMRESATTRS_K8S_POD_NAME ] = ( async ( ) => {
75- return await isAvail ? process . env . HOSTNAME : undefined ;
75+ return ( await isAvail ) ? process . env . HOSTNAME : undefined ;
7676 } ) ( ) ;
7777 attributes [ SEMRESATTRS_CONTAINER_NAME ] = ( async ( ) => {
78- return await isAvail ? process . env . CONTAINER_NAME : undefined ;
78+ return ( await isAvail ) ? process . env . CONTAINER_NAME : undefined ;
7979 } ) ( ) ;
8080 }
8181
8282 return attributes ;
8383 }
8484
8585 /** Gets project id from GCP project metadata. */
86- private async _getProjectId ( isAvail : Promise < boolean > ) : Promise < string | undefined > {
86+ private async _getProjectId (
87+ isAvail : Promise < boolean >
88+ ) : Promise < string | undefined > {
8789 if ( ! ( await isAvail ) ) {
8890 return undefined ;
8991 }
@@ -95,7 +97,9 @@ class GcpDetector implements ResourceDetector {
9597 }
9698
9799 /** Gets instance id from GCP instance metadata. */
98- private async _getInstanceId ( isAvail : Promise < boolean > ) : Promise < string | undefined > {
100+ private async _getInstanceId (
101+ isAvail : Promise < boolean >
102+ ) : Promise < string | undefined > {
99103 if ( ! ( await isAvail ) ) {
100104 return undefined ;
101105 }
@@ -108,7 +112,9 @@ class GcpDetector implements ResourceDetector {
108112 }
109113
110114 /** Gets zone from GCP instance metadata. */
111- private async _getZone ( isAvail : Promise < boolean > ) : Promise < string | undefined > {
115+ private async _getZone (
116+ isAvail : Promise < boolean >
117+ ) : Promise < string | undefined > {
112118 if ( ! ( await isAvail ) ) {
113119 return undefined ;
114120 }
@@ -124,7 +130,9 @@ class GcpDetector implements ResourceDetector {
124130 }
125131
126132 /** Gets cluster name from GCP instance metadata. */
127- private async _getClusterName ( isAvail : Promise < boolean > ) : Promise < string | undefined > {
133+ private async _getClusterName (
134+ isAvail : Promise < boolean >
135+ ) : Promise < string | undefined > {
128136 if ( ! ( await isAvail ) ) {
129137 return undefined ;
130138 }
@@ -136,7 +144,9 @@ class GcpDetector implements ResourceDetector {
136144 }
137145
138146 /** Gets hostname from GCP instance metadata. */
139- private async _getHostname ( isAvail : Promise < boolean > ) : Promise < string | undefined > {
147+ private async _getHostname (
148+ isAvail : Promise < boolean >
149+ ) : Promise < string | undefined > {
140150 if ( ! ( await isAvail ) ) {
141151 return undefined ;
142152 }
0 commit comments