--- id: opentelemetry-resource-detector-containerid version: "0.65b0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # opentelemetry-resource-detector-containerid — Container Resource Detector for OpenTelemetry License: permissive · Maintenance: active · Downloads: 177.2K/mo ## What it is and what it does This package extends OpenTelemetry's resource detection system to automatically capture container runtime metadata and attach it to traces and metrics. When initialized, the ContainerResourceDetector inspects the container environment and extracts identifiers like container ID, image name, and pod information, then registers these as resource attributes that flow through all telemetry signals. It's designed for containerized applications running on platforms like Docker, Kubernetes, or other container orchestrators. By adding container context to your telemetry, you enable better correlation of traces and metrics with the actual container instances that generated them, making it easier to debug and monitor distributed systems. The package integrates directly into OpenTelemetry's standard resource aggregation pipeline. Use it for: - Attach container ID and image metadata to traces in Kubernetes-deployed services for better observability - Correlate metrics and traces with specific container instances in multi-container environments - Automatically enrich telemetry with pod and container names for easier debugging in orchestrated deployments - Build container-aware resource attributes for OpenTelemetry exporters without manual environment parsing ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Detects and registers container runtime metadata (container ID, image name, pod details) as OpenTelemetry resource attributes for traces and metrics. Yes, if you run containerized applications and use OpenTelemetry for tracing or metrics. It automates container metadata capture with minimal setup and active maintenance. The single dependency and low install friction make it a straightforward addition to any OpenTelemetry stack. ## Install pip install opentelemetry-resource-detector-containerid uv add opentelemetry-resource-detector-containerid poetry add opentelemetry-resource-detector-containerid ## Installing opentelemetry-resource-detector-containerid Before you install: Low friction install with a single runtime dependency on opentelemetry-sdk. Active maintenance with a recent release (29 days old) and ongoing repository activity. License in practice: Apache-2.0 permissive license allows use in commercial and open-source projects with minimal restrictions. Quickstart: pip install opentelemetry-resource-detector-containerid from opentelemetry.sdk.trace import TracerProvider from opentelemetry.resource.detector.containerid import ContainerResourceDetector from opentelemetry.sdk.resources import get_aggregated_resources TracerProvider(resource=get_aggregated_resources([ContainerResourceDetector()])) Requires Python 3.10 or later; opentelemetry-sdk must be installed. Verify before relying: - Which container platforms (Docker, Kubernetes, ECS, etc.) are actually supported by this detector - Whether the detector automatically discovers container metadata or requires environment configuration ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 177.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags container resource detector opentelemetry, container id tracing, kubernetes pod metadata telemetry, docker container instrumentation, opentelemetry container attributes, observability, container-native, kubernetes [View on SkillFed](https://skillfed.io/packages/opentelemetry-resource-detector-containerid) · [View on PyPI](https://pypi.org/project/opentelemetry-resource-detector-containerid/)