From 990c6243ca69764d87fd9ec7fda72847573ba9bc Mon Sep 17 00:00:00 2001 From: Sterling Dreyer Date: Sat, 5 Oct 2024 13:40:02 -0700 Subject: [PATCH] Enable Otel On Actor (#93) --- arcade/arcade/cli/main.py | 7 ++++++- docker/Dockerfile | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arcade/arcade/cli/main.py b/arcade/arcade/cli/main.py index d6d4778d..6656cae9 100644 --- a/arcade/arcade/cli/main.py +++ b/arcade/arcade/cli/main.py @@ -524,6 +524,9 @@ def actorup( help="Disable authentication for the actor. Not recommended for production.", show_default=True, ), + otel_enable: bool = typer.Option( + False, "--otel-enable", help="Send logs to OpenTelemetry", show_default=True + ), debug: bool = typer.Option(False, "--debug", "-d", help="Show debug information"), ) -> None: """ @@ -533,7 +536,9 @@ def actorup( from arcade.cli.serve import serve_default_actor try: - serve_default_actor(host, port, disable_auth=disable_auth, debug=debug) + serve_default_actor( + host, port, disable_auth=disable_auth, enable_otel=otel_enable, debug=debug + ) except KeyboardInterrupt: typer.Exit() except Exception as e: diff --git a/docker/Dockerfile b/docker/Dockerfile index e5cd31e7..913ee76d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -49,4 +49,4 @@ RUN set -e; \ EXPOSE $PORT # Run the arcade actorup (hidden cli command) -CMD arcade actorup --host $HOST --port $PORT +CMD arcade actorup --host $HOST --port $PORT $([ "$OTEL_ENABLE" = "true" ] && echo "--otel-enable")