Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb28711

Browse files
authored
fix: align process command arguments to spec defenition (open-telemetry#4032)
1 parent 732ea8a commit eb28711

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- Update sdk process resource detector `process.command_args` attribute to also include the executable itself
11+
([#4032](https://github.com/open-telemetry/opentelemetry-python/pull/4032))
1012
- Fix `start_time_unix_nano` for delta collection for explicit bucket histogram aggregation
1113
([#4009](https://github.com/open-telemetry/opentelemetry-python/pull/4009))
1214
- Fix `start_time_unix_nano` for delta collection for sum aggregation

opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def detect(self) -> "Resource":
348348
_process_executable_path = os.path.dirname(_process_executable_name)
349349
_process_command = sys.argv[0]
350350
_process_command_line = " ".join(sys.argv)
351-
_process_command_args = sys.argv[1:]
351+
_process_command_args = sys.argv
352352
resource_info = {
353353
PROCESS_RUNTIME_DESCRIPTION: sys.version,
354354
PROCESS_RUNTIME_NAME: sys.implementation.name,

opentelemetry-sdk/tests/resources/test_resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ def test_process_detector(self):
608608
)
609609
self.assertEqual(
610610
aggregated_resource.attributes[PROCESS_COMMAND_ARGS],
611-
tuple(sys.argv[1:]),
611+
tuple(sys.argv),
612612
)
613613

614614
def test_resource_detector_entry_points_default(self):

0 commit comments

Comments
 (0)