OpenTelemetry Resource Detector for AWS
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.
Installation
npm install --save @opentelemetry/resource-detector-aws
Usage
import { detectResources } from '@opentelemetry/resources';
import { awsBeanstalkDetector } from '@opentelemetry/resource-detector-aws'
const resource = await detectResources({
detectors: [awsEc2Detector],
})
const tracerProvider = new NodeTracerProvider({ resource });
Note: Besides awsEc2Detector
there are also the following detectors available: awsBeanstalkDetector
, awsEksDetector
and awsEcsDetector
Useful links
License
Apache 2.0 - See LICENSE for more information.