From 8461fdabe508574f202d69e84b64be283f0c7738 Mon Sep 17 00:00:00 2001 From: vknelluri Date: Sun, 21 Mar 2021 16:06:11 +0530 Subject: [PATCH] chore: add resource example --- packages/opentelemetry-resources/README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/opentelemetry-resources/README.md b/packages/opentelemetry-resources/README.md index 9f39b84ae2..af86dbc113 100644 --- a/packages/opentelemetry-resources/README.md +++ b/packages/opentelemetry-resources/README.md @@ -17,7 +17,18 @@ npm install --save @opentelemetry/resources ## Usage -> TODO +```typescript +import { Resource, SERVICE_RESOURCE } from '@opentelemetry/resources'; +const resource = new Resource({ + [SERVICE_RESOURCE.NAME]: 'api-service', +}); + +const another_resource = new Resource({ + 'service.version': 2.0.0, + 'service.group': 'instrumentation-group' +}); +const merged_resource = resource.merge(another_resource); +``` ## Useful links