Skip to content

Commit

Permalink
docs: Add command line args for OpenTelemetry Subscribe sample (#1265)
Browse files Browse the repository at this point in the history
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
mukund-ananthu and gcf-owl-bot[bot] authored Sep 30, 2024
1 parent a39efb3 commit 0ff7f2a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions samples/snippets/subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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,
)

0 comments on commit 0ff7f2a

Please sign in to comment.