1.9.1 • Published 3 years ago
@m-tu/otel-js-resources v1.9.1
OpenTelemetry Resources Util
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 defines standard attributes for resources which are accessible via @opentelemetry/semantic-conventions.
Installation
npm install --save @opentelemetry/resourcesUsage
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { Resource } from '@opentelemetry/resources';
const resource = new Resource({
    [SemanticResourceAttributes.SERVICE_NAME]: 'api-service',
});
const anotherResource = new Resource({
    'service.version': '2.0.0',
    'service.group': 'instrumentation-group'
});
const mergedResource = resource.merge(anotherResource);Useful links
- For more information on OpenTelemetry, visit: https://opentelemetry.io/
- For more about OpenTelemetry JavaScript: https://github.com/open-telemetry/opentelemetry-js
- For help or feedback on this project, join us in GitHub Discussions
License
Apache 2.0 - See LICENSE for more information.
1.9.1
3 years ago