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