skillfed

opentelemetry-resource-detector-containerid

Container Resource Detector for OpenTelemetry

opentelemetry-resource-detector-containerid v0.65b0 177.2K downloads/30d#10,224 on PyPI1,086
Permissive license Apache-2.0 Active released

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-containerid

uv

uv add opentelemetry-resource-detector-containerid

poetry

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 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

container resource detector opentelemetrycontainer id tracingkubernetes pod metadata telemetrydocker container instrumentationopentelemetry container attributes
observabilitycontainer-nativekubernetes

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

opentelemetry-container-distro

Provides an OpenTelemetry distribution that…

permissive · top 5,000 on PyPI

opentelemetry-resource-detector-azure

Provides OpenTelemetry resource detectors that…

permissive · top 5,000 on PyPI

opentelemetry-resourcedetector-docker

Extracts Docker container metadata and…

permissive · top 5,000 on PyPI

opentelemetry-resourcedetector-kubernetes

Detects and populates OpenTelemetry Resource…

permissive · top 5,000 on PyPI

opentelemetry-resourcedetector-gcp

Automatically detects and reports GCP resource…

permissive · top 5,000 on PyPI

opentelemetry-sdk-extension-aws

Provides OpenTelemetry SDK components to make…

permissive · top 5,000 on PyPI

opentelemetry-resourcedetector-process

Extracts process-level metadata and populates…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-logging

Integrates Python's standard logging module…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-system-metrics

Collects system performance metrics (CPU,…

permissive · top 5,000 on PyPI

openinference-instrumentation-portkey

Automatically instruments Portkey AI API calls…

permissive · top 15,000 on PyPI