Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/opentelemetry-resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

The OpenTelemetry Resource is an immutable representation of the entity producing telemetry. For example, a process producing telemetry that is running in a container on Kubernetes has a Pod name, it is in a namespace and possibly is part of a Deployment which also has a name. All three of these attributes can be included in the `Resource`.

[This document][resource-semantic_conventions] defines standard attributes for resources.
[This document][resource-semantic_conventions] defines standard attributes for resources which are accessible via [`@opentelemetry/semantic-conventions`](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-semantic-conventions).

## Installation

Expand All @@ -18,9 +18,11 @@ npm install --save @opentelemetry/resources
## Usage

```typescript
import { Resource, SERVICE_RESOURCE } from '@opentelemetry/resources';
import { ResourceAttributes } from '@opentelemetry/semantic-conventions';
import { Resource } from '@opentelemetry/resources';

const resource = new Resource({
[SERVICE_RESOURCE.NAME]: 'api-service',
[ResourceAttributes.SERVICE_NAME]: 'api-service',
});

const another_resource = new Resource({
Expand Down