Skip to content

Update ProcessResourceDetector to not set full cli arg attrs by default#5364

Open
pmcollins wants to merge 1 commit into
open-telemetry:mainfrom
pmcollins:fix/process-resource-detector-command-args
Open

Update ProcessResourceDetector to not set full cli arg attrs by default#5364
pmcollins wants to merge 1 commit into
open-telemetry:mainfrom
pmcollins:fix/process-resource-detector-command-args

Conversation

@pmcollins

Copy link
Copy Markdown
Member

Description

Stops ProcessResourceDetector from collecting or emitting process.command_args and process.command_line by default. These attributes can contain sensitive command-line values and are opt-in in the spec.

This PR adds opt-in with ProcessResourceDetector(include_command_args=True) for users who need the current full command behavior. Auto-instrumentation/declarative config opt-in can be added separately once a config approach is agreed on.

Fixes #5358

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • uv run --with pytest==7.4.4 --with psutil==7.2.2 --with flaky==3.7.0 pytest opentelemetry-sdk/tests/resources/test_resources.py -k process_detector
  • uv run ruff check opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py opentelemetry-sdk/tests/resources/test_resources.py
  • uv run ruff format --check opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py opentelemetry-sdk/tests/resources/test_resources.py

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@pmcollins pmcollins force-pushed the fix/process-resource-detector-command-args branch 3 times, most recently from e1ec2e3 to 5a83b4e Compare June 26, 2026 17:21
@pmcollins pmcollins force-pushed the fix/process-resource-detector-command-args branch from 5a83b4e to a0f5aa4 Compare June 26, 2026 17:29
@pmcollins pmcollins marked this pull request as ready for review June 26, 2026 17:33
@pmcollins pmcollins requested a review from a team as a code owner June 26, 2026 17:33
@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

ProcessResourceDetector collects CLI args by default

3 participants