skillfed

opentelemetry-resourcedetector-kubernetes

An OpenTelemetry package to populates Resource attributes for Kubernetes pods

opentelemetry-resourcedetector-kubernetes v0.3.0 1.8M downloads/30d#3,531 on PyPI0
Permissive license Abandoned released

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

uv

uv add opentelemetry-resourcedetector-kubernetes

poetry

poetry add opentelemetry-resourcedetector-kubernetes

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3

Tags

kubernetes resource detector opentelemetryk8s pod attributes tracingopentelemetry kubernetes metadatacontainer resource detectionkubernetes downward api telemetrypod uid namespace detectionotel k8s resource attributes
kubernetesobservabilityabandoned

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

Detects and registers container runtime…

permissive · top 15,000 on PyPI

opentelemetry-resourcedetector-docker

Extracts Docker container metadata and…

permissive · top 5,000 on PyPI

opentelemetry-resourcedetector-process

Extracts process-level metadata and populates…

permissive · top 5,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-sdk-extension-aws

Provides OpenTelemetry SDK components to make…

permissive · top 5,000 on PyPI

opentelemetry-resourcedetector-gcp

Automatically detects and reports GCP resource…

permissive · top 5,000 on PyPI

opentelemetry-proto

Provides generated protobuf message classes for…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-logging

Integrates Python's standard logging module…

permissive · top 1,000 on PyPI

podman

Provides Python bindings to the Podman…

permissive · top 15,000 on PyPI