From 83b8f9cc38acfb1ebcaf7578161cc28dbf1e6fef Mon Sep 17 00:00:00 2001 From: mukund-ananthu Date: Mon, 30 Sep 2024 00:18:42 +0000 Subject: [PATCH 1/2] docs: Add command line args for OpenTelemetry Subscribe sample --- samples/snippets/subscriber.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/samples/snippets/subscriber.py b/samples/snippets/subscriber.py index 7931b31cb..5c987be69 100644 --- a/samples/snippets/subscriber.py +++ b/samples/snippets/subscriber.py @@ -1235,6 +1235,16 @@ 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 +1526,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, + ) From 2bf61a5ad71a7a7311e0864c000377786a2fcf4f Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 30 Sep 2024 03:50:45 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- samples/snippets/subscriber.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/samples/snippets/subscriber.py b/samples/snippets/subscriber.py index 5c987be69..180b091db 100644 --- a/samples/snippets/subscriber.py +++ b/samples/snippets/subscriber.py @@ -1241,9 +1241,7 @@ def callback(message: pubsub_v1.subscriber.message.Message) -> None: 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="?" - ) + 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")