Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def build_order_clause() -> str:
)
SELECT DISTINCT trace_id, root_span_id, start_time, end_time
FROM filtered_traces
WHERE root_span_id IS NOT NULL
LIMIT {limit} OFFSET {offset}
"""

Expand Down Expand Up @@ -166,7 +167,11 @@ async def get_span_tree(
return spans_by_id

async def get_trace(self, trace_id: str) -> Trace:
query = "SELECT * FROM traces WHERE trace_id = ?"
query = """
SELECT *
FROM traces t
WHERE t.trace_id = ?
"""
async with aiosqlite.connect(self.conn_string) as conn:
conn.row_factory = aiosqlite.Row
async with conn.execute(query, (trace_id,)) as cursor:
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/telemetry/test_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ def setup_telemetry_data(llama_stack_client, text_model_id):
if len(traces) < 4:
pytest.fail(f"Failed to create sufficient telemetry data after 30s. Got {len(traces)} traces.")

# Wait for 5 seconds to ensure traces has completed logging
time.sleep(5)

yield


@pytest.mark.skip(reason="Skipping telemetry tests for now")
def test_query_traces_basic(llama_stack_client):
"""Test basic trace querying functionality with proper data validation."""
all_traces = llama_stack_client.telemetry.query_traces(limit=5)
Expand Down Expand Up @@ -106,7 +108,6 @@ def test_query_traces_basic(llama_stack_client):
assert hasattr(trace, "root_span_id") and trace.root_span_id, "Each trace should have non-empty root_span_id"


@pytest.mark.skip(reason="Skipping telemetry tests for now")
def test_query_spans_basic(llama_stack_client):
"""Test basic span querying functionality with proper validation."""
spans = llama_stack_client.telemetry.query_spans(attribute_filters=[], attributes_to_return=[])
Expand Down Expand Up @@ -155,7 +156,6 @@ def test_query_spans_basic(llama_stack_client):
assert hasattr(span, attr) and getattr(span, attr), f"All spans should have non-empty {attr}"


@pytest.mark.skip(reason="Skipping telemetry tests for now")
def test_telemetry_pagination(llama_stack_client):
"""Test pagination in telemetry queries."""
# Get total count of traces
Expand Down
Loading