This OpenTelemetry package populates Resource attributes from the running process. It detects process-related information such as PID, executable name, command line, and runtime details, which are then attached to telemetry data for better context and filtering. The current version is 0.3.0, and releases appear to be ad-hoc, following updates in the broader OpenTelemetry Python ecosystem.
pip install opentelemetry-resourcedetector-processVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and use `ProcessResourceDetector` to gather process-specific attributes and combine them with other resource attributes using `get_aggregated_resources`.
Ensure your project uses Python 3.8 or newer, or pin to an older `opentelemetry-resourcedetector-process` version if Python 3.6/3.7 support is critical.
Always pass `ProcessResourceDetector()` to `get_aggregated_resources` or `Resource.create` if you intend to collect process attributes.
Periodically consult the official OpenTelemetry Semantic Conventions for resource attributes to ensure compatibility with your observability backend and dashboards.
Ensure the package is installed using pip: `pip install opentelemetry-resourcedetector-process`
Increase the timeout for resource detection (e.g., using `OTEL_EXPERIMENTAL_RESOURCE_DETECTOR_TIMEOUT` environment variable if available in newer SDK versions, or by ensuring custom detectors complete quickly). For the `ProcessResourceDetector`, ensure the `/proc` filesystem is accessible and not experiencing I/O delays in containerized environments.
The correct import statement is `from opentelemetry_resourcedetector_process import ProcessResourceDetector`.
Verify that the application has the necessary permissions to access process information (e.g., read access to `/proc` in Linux environments). In containerized setups, ensure the container's security context or Docker run flags (like `--pid=host`) allow access to host process details if needed, or that the container environment itself provides the necessary process information.