Skip to content

Commit 2f497ee

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
chore: add cloud.platform attribute to OTel resource
This applies to ADK Apps on Agent Engine and follows open-telemetry/semantic-conventions#2957. PiperOrigin-RevId: 826404720
1 parent c81f912 commit 2f497ee

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
@@ -609,6 +609,7 @@ def test_tracing_setup(
609609
"telemetry.sdk.version": "1.36.0",
610610
"gcp.project_id": "test-project",
611611
"cloud.account.id": "test-project",
612+
"cloud.platform": "gcp.agent_engine",
612613
"service.name": "test_agent_id",
613614
"cloud.resource_id": "//aiplatform.googleapis.com/projects/test-project/locations/us-central1/reasoningEngines/test_agent_id",
614615
"service.instance.id": "12345678123456781234567812345678-123123123",

tests/unit/vertex_adk/test_reasoning_engine_templates_adk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ def test_tracing_setup(
636636
"telemetry.sdk.version": "1.36.0",
637637
"gcp.project_id": "test-project",
638638
"cloud.account.id": "test-project",
639+
"cloud.platform": "gcp.agent_engine",
639640
"service.name": "test_agent_id",
640641
"cloud.resource_id": "//aiplatform.googleapis.com/projects/test-project/locations/us-central1/reasoningEngines/test_agent_id",
641642
"service.instance.id": "12345678123456781234567812345678-123123123",

vertexai/agent_engines/templates/adk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ def _detect_cloud_resource_id(project_id: str) -> Optional[str]:
320320
attributes={
321321
"gcp.project_id": project_id,
322322
"cloud.account.id": project_id,
323+
"cloud.platform": "gcp.agent_engine",
323324
"service.name": os.getenv("GOOGLE_CLOUD_AGENT_ENGINE_ID", ""),
324325
"service.instance.id": f"{uuid.uuid4().hex}-{os.getpid()}",
325326
"cloud.region": os.getenv("GOOGLE_CLOUD_LOCATION", ""),

vertexai/preview/reasoning_engines/templates/adk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ def _detect_cloud_resource_id(project_id: str) -> Optional[str]:
300300
attributes={
301301
"gcp.project_id": project_id,
302302
"cloud.account.id": project_id,
303+
"cloud.platform": "gcp.agent_engine",
303304
"service.name": os.getenv("GOOGLE_CLOUD_AGENT_ENGINE_ID", ""),
304305
"service.instance.id": f"{uuid.uuid4().hex}-{os.getpid()}",
305306
"cloud.region": os.getenv("GOOGLE_CLOUD_LOCATION", ""),

0 commit comments

Comments
 (0)