opentelemetry-resource-detector-containerid
Container Resource Detector for OpenTelemetry
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 on this page — 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
opentelemetry-resource-detector-containerid on PyPI
pip
pip install opentelemetry-resource-detector-containeriduv
uv add opentelemetry-resource-detector-containeridpoetry
poetry add opentelemetry-resource-detector-containeridInstalling 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 the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — opentelemetry-sdk |
| Maintenance | actively maintained — 29 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 177,169/month — #10,224 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: opentelemetry_resource_detector_containerid-0.65b0-py3-none-any.whl
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
opentelemetry-container-distroProvides an OpenTelemetry distribution that…
permissive · top 5,000 on PyPI
opentelemetry-resource-detector-azureProvides OpenTelemetry resource detectors that…
permissive · top 5,000 on PyPI
opentelemetry-resourcedetector-dockerExtracts Docker container metadata and…
permissive · top 5,000 on PyPI
opentelemetry-resourcedetector-kubernetesDetects and populates OpenTelemetry Resource…
permissive · top 5,000 on PyPI
opentelemetry-resourcedetector-gcpAutomatically detects and reports GCP resource…
permissive · top 5,000 on PyPI
opentelemetry-sdk-extension-awsProvides OpenTelemetry SDK components to make…
permissive · top 5,000 on PyPI
opentelemetry-resourcedetector-processExtracts process-level metadata and populates…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-loggingIntegrates Python's standard logging module…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-system-metricsCollects system performance metrics (CPU,…
permissive · top 5,000 on PyPI
openinference-instrumentation-portkeyAutomatically instruments Portkey AI API calls…
permissive · top 15,000 on PyPI