OpenTelemetry Resource Detector for Container
[![NPM Published Version][npm-img]][npm-url]
component owners: @abhee11
Resource detector for container id.
Compatible with OpenTelemetry JS API and SDK 1.0+
.
Installation
npm install --save @opentelemetry/resource-detector-container
Usage
import { detectResources } from '@opentelemetry/resources';
import { containerDetector } from '@opentelemetry/resource-detector-container'
const resource = await detectResources({
detectors: [containerDetector],
})
const tracerProvider = new NodeTracerProvider({ resource });
Available detectors
containerDetector
: Populates container.id
for processes running on contianers supporting : docker( cgroup v1 or v2 ) or with containerd
Useful links
License
Apache 2.0 - See LICENSE for more information.