@@ -33,7 +33,7 @@ import {
3333 SEMRESATTRS_K8S_CLUSTER_NAME ,
3434} from '@opentelemetry/semantic-conventions' ;
3535
36- import { AttributeValue , Attributes } from '@opentelemetry/api' ;
36+ import { AttributeValue , Attributes } from '@opentelemetry/api' ;
3737import {
3838 DetectedResource ,
3939 DetectedResourceAttributes ,
@@ -152,7 +152,7 @@ async function gaeResource(): Promise<Resource> {
152152 gae . standardCloudRegion ( ) ,
153153 ] ) ;
154154 } else {
155- ( { zone, region} = await gce . availabilityZoneAndRegion ( ) ) ;
155+ ( { zone, region } = await gce . availabilityZoneAndRegion ( ) ) ;
156156 }
157157 const [ faasName , faasVersion , faasInstance ] = await Promise . all ( [
158158 gae . serviceName ( ) ,
@@ -202,7 +202,7 @@ async function makeResource(attrs: GcpResourceAttributes): Promise<Resource> {
202202 * Google Cloud resource detector which populates attributes based on the environment this
203203 * process is running in. If not on GCP, returns an empty resource.
204204 */
205- export class GcpDetectorSync implements ResourceDetector {
205+ export class GcpDetector implements ResourceDetector {
206206 private async _asyncAttributes ( ) : Promise < Attributes > {
207207 return ( await detect ( ) ) . attributes ;
208208 }
@@ -215,6 +215,8 @@ export class GcpDetectorSync implements ResourceDetector {
215215 attributes [ name ] = asyncAttributes . then ( data => data [ name ] ) ;
216216 } ) ;
217217
218- return { attributes} ;
218+ return { attributes } ;
219219 }
220220}
221+
222+ export const gcpDetector = new GcpDetector ( ) ;
0 commit comments