From 35b892f85db4d1e1622d9e9a038463042c7feeb9 Mon Sep 17 00:00:00 2001 From: Weyert de Boer Date: Wed, 10 Mar 2021 04:57:41 +0000 Subject: [PATCH 1/2] doc: add usage to README.md of gcp detector Add gcp detector usage explanation to README.md file of GCP detector package --- packages/opentelemetry-resource-detector-gcp/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/opentelemetry-resource-detector-gcp/README.md b/packages/opentelemetry-resource-detector-gcp/README.md index b87827ccc1..fa64044d9f 100644 --- a/packages/opentelemetry-resource-detector-gcp/README.md +++ b/packages/opentelemetry-resource-detector-gcp/README.md @@ -19,7 +19,15 @@ npm install --save @opentelemetry/resource-detector-gcp ## Usage -> TODO +``` +import { detectResources } from '@opentelemetry/resources'; +import { gcpDetector } from '@opentelemetry/resource-detector-gcp' +const resource = await detectResources({ + detectors: [gcpDetector], +}) + +const tracerProvider = new NodeTracerProvider({ resource }); +``` ## Useful links From a94e3b8e9518b3ed932fd45c3970091c95ce8c36 Mon Sep 17 00:00:00 2001 From: Weyert de Boer Date: Wed, 10 Mar 2021 07:46:25 +0000 Subject: [PATCH 2/2] style: fix markdown linting issue --- packages/opentelemetry-resource-detector-gcp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opentelemetry-resource-detector-gcp/README.md b/packages/opentelemetry-resource-detector-gcp/README.md index fa64044d9f..d81d80ce9f 100644 --- a/packages/opentelemetry-resource-detector-gcp/README.md +++ b/packages/opentelemetry-resource-detector-gcp/README.md @@ -19,7 +19,7 @@ npm install --save @opentelemetry/resource-detector-gcp ## Usage -``` +```typescript import { detectResources } from '@opentelemetry/resources'; import { gcpDetector } from '@opentelemetry/resource-detector-gcp' const resource = await detectResources({