Socket
Socket
Sign inDemoInstall

@opentelemetry/resource-detector-container

Package Overview
Dependencies
0
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @opentelemetry/resource-detector-container

Opentelemetry resource detector to get container resource attributes


Version published
Weekly downloads
449K
increased by1.66%
Maintainers
3
Install size
2.95 MB
Created
Weekly downloads
 

Readme

Source

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 AttributeDescription
container.idValue parsed from file /proc/self/cgroup (cgroup v1). If it doesn't exist, parse the value from file /proc/self/mountinfo (cgroup v2)

License

Apache 2.0 - See LICENSE for more information.

FAQs

Last updated on 25 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc