Skip to content

Commit 5f862d5

Browse files
committed
Rename and expose an instance to match repo style
1 parent 75098c5 commit 5f862d5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/resource-detector-gcp/src/detectors/detector.ts renamed to packages/resource-detector-gcp/src/detectors/GcpDetector.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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';
3737
import {
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

Comments
 (0)