From 77d9023fcaae25f77acac6f2781398d8ac1f8848 Mon Sep 17 00:00:00 2001 From: Pablo Collins Date: Mon, 2 Dec 2024 14:32:24 -0500 Subject: [PATCH] Add process resource detector (#564) * Add process resource detector * Lint --- src/splunk_otel/env.py | 2 +- tests/ott_spec.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/splunk_otel/env.py b/src/splunk_otel/env.py index 2db0718..15bfc10 100644 --- a/src/splunk_otel/env.py +++ b/src/splunk_otel/env.py @@ -27,7 +27,7 @@ "OTEL_LINK_ATTRIBUTE_COUNT_LIMIT": "", "OTEL_SPAN_LINK_COUNT_LIMIT": "1000", "OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT": "12000", - "OTEL_EXPERIMENTAL_RESOURCE_DETECTORS": "host", + "OTEL_EXPERIMENTAL_RESOURCE_DETECTORS": "host,process", "OTEL_TRACES_SAMPLER": "always_on", } diff --git a/tests/ott_spec.py b/tests/ott_spec.py index 6c91853..89886eb 100644 --- a/tests/ott_spec.py +++ b/tests/ott_spec.py @@ -28,6 +28,8 @@ def on_stop(self, telemetry, stdout: str, stderr: str, returncode: int) -> None: assert get_attribute_str(attributes, "telemetry.distro.version") assert get_attribute_str(attributes, "telemetry.distro.name") == "splunk-opentelemetry" + assert get_attribute(attributes, "process.pid") + def is_http(self): return False