chore(otel): Change default of trace_to_cloud to None for Agent Engine deploy

Also added --no-trace_to_cloud to allow for explicit disablement.

This is needed to distinguish between default-on telemetry and explicit disablement via old enable_tracing/trace_to_cloud flags. Same change was done to ADK templates - see https://github.com/googleapis/python-aiplatform/pull/5917/files#diff-54084046c0ff3ec289916eefbb00d04f797ebd02dc15b417fc4fc88137fd2123R439.

Co-authored-by: Kacper Jawoszek <jawoszek@google.com>
PiperOrigin-RevId: 827552868
This commit is contained in:
Kacper Jawoszek
2025-11-03 10:21:12 -08:00
committed by Copybara-Service
parent 308da620c1
commit a02f321f1b
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -345,7 +345,7 @@ def to_agent_engine(
temp_folder: str,
adk_app: str,
staging_bucket: str,
trace_to_cloud: bool,
trace_to_cloud: Optional[bool] = None,
agent_engine_id: Optional[str] = None,
absolutize_imports: bool = True,
project: Optional[str] = None,
+3 -3
View File
@@ -1495,11 +1495,11 @@ def cli_deploy_cloud_run(
),
)
@click.option(
"--trace_to_cloud",
"--trace_to_cloud/--no-trace_to_cloud",
type=bool,
is_flag=True,
show_default=True,
default=False,
default=None,
help="Optional. Whether to enable Cloud Trace for Agent Engine.",
)
@click.option(
@@ -1591,7 +1591,7 @@ def cli_deploy_agent_engine(
region: str,
staging_bucket: str,
agent_engine_id: Optional[str],
trace_to_cloud: bool,
trace_to_cloud: Optional[bool],
display_name: str,
description: str,
adk_app: str,