From 28ff6d8659e774005f75ee47cac605c3640e493a Mon Sep 17 00:00:00 2001 From: Emilio Garcia Date: Mon, 1 Dec 2025 13:40:57 -0500 Subject: [PATCH] fix: remove telemetry_traceable (#4205) # What does this PR do? Removes stale data from llama stack about old telemetry system **Depends on** https://github.com/llamastack/llama-stack/pull/4127 Co-authored-by: Ashwin Bharambe --- src/llama_stack_api/common/tracing.py | 22 ---------------------- src/llama_stack_api/conversations.py | 2 -- src/llama_stack_api/files.py | 2 -- src/llama_stack_api/inference.py | 2 -- src/llama_stack_api/models.py | 2 -- src/llama_stack_api/prompts.py | 2 -- src/llama_stack_api/safety.py | 2 -- src/llama_stack_api/shields.py | 2 -- src/llama_stack_api/tools.py | 3 --- src/llama_stack_api/vector_io.py | 2 -- 10 files changed, 41 deletions(-) delete mode 100644 src/llama_stack_api/common/tracing.py diff --git a/src/llama_stack_api/common/tracing.py b/src/llama_stack_api/common/tracing.py deleted file mode 100644 index 830c2945a..000000000 --- a/src/llama_stack_api/common/tracing.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - - -def telemetry_traceable(cls): - """ - Mark a protocol for automatic tracing when telemetry is enabled. - - This is a metadata-only decorator with no dependencies on core. - Actual tracing is applied by core routers at runtime if telemetry is enabled. - - Usage: - @runtime_checkable - @telemetry_traceable - class MyProtocol(Protocol): - ... - """ - cls.__marked_for_tracing__ = True - return cls diff --git a/src/llama_stack_api/conversations.py b/src/llama_stack_api/conversations.py index 4854181d1..81b5ab2c4 100644 --- a/src/llama_stack_api/conversations.py +++ b/src/llama_stack_api/conversations.py @@ -9,7 +9,6 @@ from typing import Annotated, Literal, Protocol, runtime_checkable from pydantic import BaseModel, Field -from llama_stack_api.common.tracing import telemetry_traceable from llama_stack_api.openai_responses import ( OpenAIResponseInputFunctionToolCallOutput, OpenAIResponseMCPApprovalRequest, @@ -157,7 +156,6 @@ class ConversationItemDeletedResource(BaseModel): @runtime_checkable -@telemetry_traceable class Conversations(Protocol): """Conversations diff --git a/src/llama_stack_api/files.py b/src/llama_stack_api/files.py index 8a75a1c39..e515fe0ae 100644 --- a/src/llama_stack_api/files.py +++ b/src/llama_stack_api/files.py @@ -11,7 +11,6 @@ from fastapi import File, Form, Response, UploadFile from pydantic import BaseModel, Field from llama_stack_api.common.responses import Order -from llama_stack_api.common.tracing import telemetry_traceable from llama_stack_api.schema_utils import json_schema_type, webmethod from llama_stack_api.version import LLAMA_STACK_API_V1 @@ -102,7 +101,6 @@ class OpenAIFileDeleteResponse(BaseModel): @runtime_checkable -@telemetry_traceable class Files(Protocol): """Files diff --git a/src/llama_stack_api/inference.py b/src/llama_stack_api/inference.py index b42de95be..4a169486a 100644 --- a/src/llama_stack_api/inference.py +++ b/src/llama_stack_api/inference.py @@ -22,7 +22,6 @@ from llama_stack_api.common.content_types import InterleavedContent from llama_stack_api.common.responses import ( Order, ) -from llama_stack_api.common.tracing import telemetry_traceable from llama_stack_api.models import Model from llama_stack_api.schema_utils import json_schema_type, register_schema, webmethod from llama_stack_api.version import LLAMA_STACK_API_V1, LLAMA_STACK_API_V1ALPHA @@ -989,7 +988,6 @@ class OpenAIEmbeddingsRequestWithExtraBody(BaseModel, extra="allow"): @runtime_checkable -@telemetry_traceable class InferenceProvider(Protocol): """ This protocol defines the interface that should be implemented by all inference providers. diff --git a/src/llama_stack_api/models.py b/src/llama_stack_api/models.py index 98c16b6c2..3efdfe66b 100644 --- a/src/llama_stack_api/models.py +++ b/src/llama_stack_api/models.py @@ -9,7 +9,6 @@ from typing import Any, Literal, Protocol, runtime_checkable from pydantic import BaseModel, ConfigDict, Field, field_validator -from llama_stack_api.common.tracing import telemetry_traceable from llama_stack_api.resource import Resource, ResourceType from llama_stack_api.schema_utils import json_schema_type, webmethod from llama_stack_api.version import LLAMA_STACK_API_V1 @@ -106,7 +105,6 @@ class OpenAIListModelsResponse(BaseModel): @runtime_checkable -@telemetry_traceable class Models(Protocol): async def list_models(self) -> ListModelsResponse: """List all models. diff --git a/src/llama_stack_api/prompts.py b/src/llama_stack_api/prompts.py index 8562e4704..2054ccd30 100644 --- a/src/llama_stack_api/prompts.py +++ b/src/llama_stack_api/prompts.py @@ -10,7 +10,6 @@ from typing import Protocol, runtime_checkable from pydantic import BaseModel, Field, field_validator, model_validator -from llama_stack_api.common.tracing import telemetry_traceable from llama_stack_api.schema_utils import json_schema_type, webmethod from llama_stack_api.version import LLAMA_STACK_API_V1 @@ -93,7 +92,6 @@ class ListPromptsResponse(BaseModel): @runtime_checkable -@telemetry_traceable class Prompts(Protocol): """Prompts diff --git a/src/llama_stack_api/safety.py b/src/llama_stack_api/safety.py index ef84be2ea..7b4f2af5c 100644 --- a/src/llama_stack_api/safety.py +++ b/src/llama_stack_api/safety.py @@ -9,7 +9,6 @@ from typing import Any, Protocol, runtime_checkable from pydantic import BaseModel, Field -from llama_stack_api.common.tracing import telemetry_traceable from llama_stack_api.inference import OpenAIMessageParam from llama_stack_api.schema_utils import json_schema_type, webmethod from llama_stack_api.shields import Shield @@ -94,7 +93,6 @@ class ShieldStore(Protocol): @runtime_checkable -@telemetry_traceable class Safety(Protocol): """Safety diff --git a/src/llama_stack_api/shields.py b/src/llama_stack_api/shields.py index 19e412a5a..36ad2351b 100644 --- a/src/llama_stack_api/shields.py +++ b/src/llama_stack_api/shields.py @@ -8,7 +8,6 @@ from typing import Any, Literal, Protocol, runtime_checkable from pydantic import BaseModel -from llama_stack_api.common.tracing import telemetry_traceable from llama_stack_api.resource import Resource, ResourceType from llama_stack_api.schema_utils import json_schema_type, webmethod from llama_stack_api.version import LLAMA_STACK_API_V1 @@ -49,7 +48,6 @@ class ListShieldsResponse(BaseModel): @runtime_checkable -@telemetry_traceable class Shields(Protocol): @webmethod(route="/shields", method="GET", level=LLAMA_STACK_API_V1) async def list_shields(self) -> ListShieldsResponse: diff --git a/src/llama_stack_api/tools.py b/src/llama_stack_api/tools.py index 4dd5d55d2..94f2251b0 100644 --- a/src/llama_stack_api/tools.py +++ b/src/llama_stack_api/tools.py @@ -11,7 +11,6 @@ from pydantic import BaseModel from typing_extensions import runtime_checkable from llama_stack_api.common.content_types import URL, InterleavedContent -from llama_stack_api.common.tracing import telemetry_traceable from llama_stack_api.resource import Resource, ResourceType from llama_stack_api.schema_utils import json_schema_type, webmethod from llama_stack_api.version import LLAMA_STACK_API_V1 @@ -109,7 +108,6 @@ class ListToolDefsResponse(BaseModel): @runtime_checkable -@telemetry_traceable class ToolGroups(Protocol): @webmethod(route="/toolgroups", method="POST", level=LLAMA_STACK_API_V1, deprecated=True) async def register_tool_group( @@ -191,7 +189,6 @@ class SpecialToolGroup(Enum): @runtime_checkable -@telemetry_traceable class ToolRuntime(Protocol): tool_store: ToolStore | None = None diff --git a/src/llama_stack_api/vector_io.py b/src/llama_stack_api/vector_io.py index 135468d19..188ea3307 100644 --- a/src/llama_stack_api/vector_io.py +++ b/src/llama_stack_api/vector_io.py @@ -13,7 +13,6 @@ from typing import Annotated, Any, Literal, Protocol, runtime_checkable from fastapi import Body, Query from pydantic import BaseModel, Field, field_validator -from llama_stack_api.common.tracing import telemetry_traceable from llama_stack_api.inference import InterleavedContent from llama_stack_api.schema_utils import json_schema_type, register_schema, webmethod from llama_stack_api.vector_stores import VectorStore @@ -572,7 +571,6 @@ class VectorStoreTable(Protocol): @runtime_checkable -@telemetry_traceable class VectorIO(Protocol): vector_store_table: VectorStoreTable | None = None