mirror of
https://github.com/meta-llama/llama-stack.git
synced 2026-01-03 12:32:17 +00:00
Idimatic REST API: Telemetry
This commit is contained in:
parent
8d30ecb91a
commit
749bc74509
3 changed files with 39 additions and 23 deletions
|
|
@ -21,13 +21,13 @@ from llama_stack.apis.telemetry import (
|
|||
Event,
|
||||
MetricEvent,
|
||||
QueryCondition,
|
||||
QuerySpanTreeResponse,
|
||||
QueryTracesResponse,
|
||||
SpanEndPayload,
|
||||
SpanStartPayload,
|
||||
SpanStatus,
|
||||
SpanWithStatus,
|
||||
StructuredLogEvent,
|
||||
Telemetry,
|
||||
Trace,
|
||||
UnstructuredLogEvent,
|
||||
)
|
||||
from llama_stack.distribution.datatypes import Api
|
||||
|
|
@ -241,12 +241,14 @@ class TelemetryAdapter(TelemetryDatasetMixin, Telemetry):
|
|||
limit: Optional[int] = 100,
|
||||
offset: Optional[int] = 0,
|
||||
order_by: Optional[List[str]] = None,
|
||||
) -> List[Trace]:
|
||||
return await self.trace_store.query_traces(
|
||||
attribute_filters=attribute_filters,
|
||||
limit=limit,
|
||||
offset=offset,
|
||||
order_by=order_by,
|
||||
) -> QueryTracesResponse:
|
||||
return QueryTracesResponse(
|
||||
data=await self.trace_store.query_traces(
|
||||
attribute_filters=attribute_filters,
|
||||
limit=limit,
|
||||
offset=offset,
|
||||
order_by=order_by,
|
||||
)
|
||||
)
|
||||
|
||||
async def query_span_tree(
|
||||
|
|
@ -254,9 +256,11 @@ class TelemetryAdapter(TelemetryDatasetMixin, Telemetry):
|
|||
span_id: str,
|
||||
attributes_to_return: Optional[List[str]] = None,
|
||||
max_depth: Optional[int] = None,
|
||||
) -> Dict[str, SpanWithStatus]:
|
||||
return await self.trace_store.get_span_tree(
|
||||
span_id=span_id,
|
||||
attributes_to_return=attributes_to_return,
|
||||
max_depth=max_depth,
|
||||
) -> QuerySpanTreeResponse:
|
||||
return QuerySpanTreeResponse(
|
||||
data=await self.trace_store.get_span_tree(
|
||||
span_id=span_id,
|
||||
attributes_to_return=attributes_to_return,
|
||||
max_depth=max_depth,
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue