opentelemetry-resourcedetector-kubernetes
An OpenTelemetry package to populates Resource attributes for Kubernetes pods
What it is and what it does
This package provides resource detectors for OpenTelemetry that extract Kubernetes pod metadata and attach it to trace resources. It implements three detector classes: a base KubernetesResourceDetector that always populates container.runtime, container.id, and k8s.pod.uid; and two variants that use the Kubernetes Downward API to read additional metadata either from environment variables or from mounted volume files. You pass one of these detectors to OpenTelemetry's get_aggregated_resources() function, which returns a Resource object you then pass to a TracerProvider.
The package depends on opentelemetry-sdk and opentelemetry-semantic-conventions, and requires Python 3.8 or later. It is designed specifically for workloads running inside Kubernetes pods and will not detect meaningful metadata outside that environment. The Downward API variants require explicit configuration in your Kubernetes manifests to expose pod metadata as either environment variables or volume-mounted files.
Use it for:
- Automatically tag traces with the Kubernetes pod UID and container ID for correlation in observability platforms.
- Populate k8s.namespace.name and k8s.pod.name in traces by configuring Downward API environment variables in your pod spec.
- Mount Kubernetes metadata as files and read namespace, pod name, and other attributes via the volume-based Downward API detector.
- Integrate Kubernetes pod context into OpenTelemetry traces without manual hardcoding of pod identifiers.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Detects and populates OpenTelemetry Resource attributes specific to Kubernetes pods, including container ID, pod UID, and namespace/pod name via the Kubernetes Downward API.
No. The package is abandoned (last release 2022-09-18, no commits since) and will receive no maintenance or updates. While it has low install friction and permissive licensing, the lack of maintenance means compatibility with current OpenTelemetry versions is uncertain and bugs will not be fixed. If you need Kubernetes resource detection for OpenTelemetry, seek an actively maintained alternative or verify this package still works with your current dependencies.
Install
opentelemetry-resourcedetector-kubernetes on PyPI
pip
pip install opentelemetry-resourcedetector-kubernetesuv
uv add opentelemetry-resourcedetector-kubernetespoetry
poetry add opentelemetry-resourcedetector-kubernetesInstalling opentelemetry-resourcedetector-kubernetes
Before you install
Low install friction with only two runtime dependencies (opentelemetry-sdk and opentelemetry-semantic-conventions). However, the package is abandoned—last release was 2022-09-18 with no commits since then—so expect no maintenance, bug fixes, or updates.
License in practice
Licensed under MIT (permissive), so you can use it freely in commercial and private projects without copyleft obligations.
Quickstart
pip install opentelemetry-resourcedetector-kubernetes
from opentelemetry.sdk.resources import get_aggregated_resources
from opentelemetry_resourcedetector_kubernetes import KubernetesResourceDetector
resource = get_aggregated_resources([KubernetesResourceDetector()])
Must be running inside a Kubernetes pod; the detector will not populate meaningful attributes outside that environment.
Verify before relying
- Whether the package remains compatible with current versions of opentelemetry-sdk and opentelemetry-semantic-conventions despite being unmaintained.
- Whether Kubernetes Downward API behavior or OpenTelemetry semantic conventions have changed since the last release in 2022.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — opentelemetry-sdk, opentelemetry-semantic-conventions |
| Maintenance | abandoned — 1,426 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,810,652/month — #3,531 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: opentelemetry_resourcedetector_kubernetes-0.3.0-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-resource-detector-containeridDetects and registers container runtime…
permissive · top 15,000 on PyPI
opentelemetry-resourcedetector-dockerExtracts Docker container metadata and…
permissive · top 5,000 on PyPI
opentelemetry-resourcedetector-processExtracts process-level metadata and populates…
permissive · top 5,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-sdk-extension-awsProvides OpenTelemetry SDK components to make…
permissive · top 5,000 on PyPI
opentelemetry-resourcedetector-gcpAutomatically detects and reports GCP resource…
permissive · top 5,000 on PyPI
opentelemetry-protoProvides generated protobuf message classes for…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-loggingIntegrates Python's standard logging module…
permissive · top 1,000 on PyPI
podmanProvides Python bindings to the Podman…
permissive · top 15,000 on PyPI