From a1d27cd1325db9988914301f7ed80a3fbd6edec2 Mon Sep 17 00:00:00 2001 From: ddyczek Date: Mon, 21 Jul 2025 15:50:03 +0200 Subject: [PATCH 1/3] remove: unused import --- docs/examples/auto-instrumentation/client.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/examples/auto-instrumentation/client.py b/docs/examples/auto-instrumentation/client.py index 0320493f94a..7969710b418 100644 --- a/docs/examples/auto-instrumentation/client.py +++ b/docs/examples/auto-instrumentation/client.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from sys import argv from requests import get @@ -31,16 +30,13 @@ BatchSpanProcessor(ConsoleSpanExporter()) ) - -assert len(argv) == 2 - with tracer.start_as_current_span("client"): with tracer.start_as_current_span("client-server"): headers = {} inject(headers) requested = get( "http://localhost:8082/server_request", - params={"param": argv[1]}, + params={"param": "testing"}, headers=headers, ) From 6ed12a5db310aa41ddaecdf7a03b83e1b47910e0 Mon Sep 17 00:00:00 2001 From: ddyczek Date: Mon, 28 Jul 2025 10:49:37 +0200 Subject: [PATCH 2/3] add CLI parameter support with backward compatibility in client.py --- docs/examples/auto-instrumentation/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/examples/auto-instrumentation/client.py b/docs/examples/auto-instrumentation/client.py index 7969710b418..7ef26713b89 100644 --- a/docs/examples/auto-instrumentation/client.py +++ b/docs/examples/auto-instrumentation/client.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import sys from requests import get @@ -30,13 +31,15 @@ BatchSpanProcessor(ConsoleSpanExporter()) ) +param_value = sys.argv[1] if len(sys.argv) > 1 else "testing" + with tracer.start_as_current_span("client"): with tracer.start_as_current_span("client-server"): headers = {} inject(headers) requested = get( "http://localhost:8082/server_request", - params={"param": "testing"}, + params={"param": param_value}, headers=headers, ) From a14974042abaab94796bf9632d683e37b5e29489 Mon Sep 17 00:00:00 2001 From: ddyczek Date: Wed, 30 Jul 2025 13:12:18 +0200 Subject: [PATCH 3/3] add comment explaining parameter usage --- docs/examples/auto-instrumentation/client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/examples/auto-instrumentation/client.py b/docs/examples/auto-instrumentation/client.py index 7ef26713b89..508a9b11de7 100644 --- a/docs/examples/auto-instrumentation/client.py +++ b/docs/examples/auto-instrumentation/client.py @@ -31,6 +31,7 @@ BatchSpanProcessor(ConsoleSpanExporter()) ) +# Get parameter from command line argument or use default value "testing" param_value = sys.argv[1] if len(sys.argv) > 1 else "testing" with tracer.start_as_current_span("client"):