From 0ff7f2a64b5aa1b0e014e0933e4edaef0fb3f222 Mon Sep 17 00:00:00 2001 From: mukund-ananthu <83691193+mukund-ananthu@users.noreply.github.com> Date: Mon, 30 Sep 2024 13:20:37 -0400 Subject: [PATCH] docs: Add command line args for OpenTelemetry Subscribe sample (#1265) Co-authored-by: Owl Bot --- samples/snippets/subscriber.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/samples/snippets/subscriber.py b/samples/snippets/subscriber.py index 7931b31cb..180b091db 100644 --- a/samples/snippets/subscriber.py +++ b/samples/snippets/subscriber.py @@ -1235,6 +1235,14 @@ def callback(message: pubsub_v1.subscriber.message.Message) -> None: "list-in-project", help=list_subscriptions_in_project.__doc__ ) + otel_subscribe_parse = subparsers.add_parser( + "otel-subscribe", help=pubsub_subscribe_otel_tracing.__doc__ + ) + otel_subscribe_parse.add_argument("subscription_project_id") + otel_subscribe_parse.add_argument("cloud_trace_project_id") + otel_subscribe_parse.add_argument("subscription_id") + otel_subscribe_parse.add_argument("timeout", default=None, type=float, nargs="?") + create_parser = subparsers.add_parser("create", help=create_subscription.__doc__) create_parser.add_argument("topic_id") create_parser.add_argument("subscription_id") @@ -1516,3 +1524,10 @@ def callback(message: pubsub_v1.subscriber.message.Message) -> None: receive_messages_with_concurrency_control( args.project_id, args.subscription_id, args.timeout ) + elif args.command == "otel-subscribe": + pubsub_subscribe_otel_tracing( + args.subscription_project_id, + args.cloud_trace_project_id, + args.subscription_id, + args.timeout, + )