@opentelemetry/resource-detector-container
TypeScript icon, indicating that this package has built-in type declarations

0.3.9 • Public • Published

OpenTelemetry Resource Detector for Container

[![NPM Published Version][npm-img]][npm-url] Apache License

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

This package uses @opentelemetry/semantic-conventions version 1.22+, which implements Semantic Convention Version 1.7.0

ContainerDetector

Populates container.id for processes running on containers supporting : docker( cgroup v1 or v2 ) or with containerd

Resource Attribute Description
container.id Value parsed from file /proc/self/cgroup (cgroup v1). If it doesn't exist, parse the value from file /proc/self/mountinfo (cgroup v2)

Useful links

License

Apache 2.0 - See LICENSE for more information.

Readme

Keywords

none

Package Sidebar

Install

npm i @opentelemetry/resource-detector-container

Weekly Downloads

451,671

Version

0.3.9

License

Apache-2.0

Unpacked Size

34 kB

Total Files

15

Last publish

Collaborators

  • pichlermarc
  • bogdandrutu
  • dyladan