Skip to content

Commit 7d3bcdd

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
fix: add OTel cloud.provider attribute to AdkTemplate
PiperOrigin-RevId: 836767825
1 parent 186e6d8 commit 7d3bcdd

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

tests/unit/vertex_adk/test_agent_engine_templates_adk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@ def test_tracing_setup(
771771
"telemetry.sdk.version": "1.36.0",
772772
"gcp.project_id": "test-project",
773773
"cloud.account.id": "test-project",
774+
"cloud.provider": "gcp",
774775
"cloud.platform": "gcp.agent_engine",
775776
"service.name": "test_agent_id",
776777
"cloud.resource_id": "//aiplatform.googleapis.com/projects/test-project/locations/us-central1/reasoningEngines/test_agent_id",

tests/unit/vertex_adk/test_reasoning_engine_templates_adk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@ def test_tracing_setup(
713713
"telemetry.sdk.version": "1.36.0",
714714
"gcp.project_id": "test-project",
715715
"cloud.account.id": "test-project",
716+
"cloud.provider": "gcp",
716717
"cloud.platform": "gcp.agent_engine",
717718
"service.name": "test_agent_id",
718719
"cloud.resource_id": "//aiplatform.googleapis.com/projects/test-project/locations/us-central1/reasoningEngines/test_agent_id",

vertexai/agent_engines/templates/adk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ def _detect_cloud_resource_id(project_id: str) -> Optional[str]:
348348
attributes={
349349
"gcp.project_id": project_id,
350350
"cloud.account.id": project_id,
351+
"cloud.provider": "gcp",
351352
"cloud.platform": "gcp.agent_engine",
352353
"service.name": os.getenv("GOOGLE_CLOUD_AGENT_ENGINE_ID", ""),
353354
"service.instance.id": f"{uuid.uuid4().hex}-{os.getpid()}",

vertexai/preview/reasoning_engines/templates/adk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ def _detect_cloud_resource_id(project_id: str) -> Optional[str]:
350350
attributes={
351351
"gcp.project_id": project_id,
352352
"cloud.account.id": project_id,
353+
"cloud.provider": "gcp",
353354
"cloud.platform": "gcp.agent_engine",
354355
"service.name": os.getenv("GOOGLE_CLOUD_AGENT_ENGINE_ID", ""),
355356
"service.instance.id": f"{uuid.uuid4().hex}-{os.getpid()}",

0 commit comments

Comments
 (0)