Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@ardaerzin the files that matters most:
|
Railway Preview Environment
|
loadables in apiloadables in api
| elif traces: | ||
| for spans_tree in traces.values(): | ||
| if spans_tree.spans: | ||
| for span in spans_tree.spans.values(): | ||
| if not isinstance(span, list): | ||
| _spans[span.span_id] = OTelSpan( | ||
| **span.model_dump( | ||
| mode="json", | ||
| exclude_none=True, | ||
| exclude_unset=True, | ||
| ) | ||
| ) |
There was a problem hiding this comment.
🔴 ingest_spans silently drops list-typed spans from trace trees, causing data loss
When ingest_spans processes spans from the traces parameter (trace tree format), it skips list-typed span values at line 185: if not isinstance(span, list). In the OTelNestedSpans type (Dict[str, Union[SpansNode, List[SpansNode]]]), spans with duplicate names within a trace are stored as List[SpansNode]. These are valid spans that the downstream parse_spans_from_request (api/oss/src/core/tracing/utils/parsing.py:346-365) correctly handles (it extends raw_span_dtos for list-typed values). However, the pre-filtering at line 185 silently discards them before they reach that parser.
This affects all trace ingestion flows that use the traces parameter: TracesRouter.create_trace, TracesRouter.ingest_traces, and the legacy TracingRouter.create_trace / edit_trace. Any trace containing two or more spans with the same name will have those duplicate-named spans silently dropped.
| elif traces: | |
| for spans_tree in traces.values(): | |
| if spans_tree.spans: | |
| for span in spans_tree.spans.values(): | |
| if not isinstance(span, list): | |
| _spans[span.span_id] = OTelSpan( | |
| **span.model_dump( | |
| mode="json", | |
| exclude_none=True, | |
| exclude_unset=True, | |
| ) | |
| ) | |
| elif traces: | |
| for spans_tree in traces.values(): | |
| if spans_tree.spans: | |
| for span in spans_tree.spans.values(): | |
| if isinstance(span, list): | |
| for s in span: | |
| _spans[s.span_id] = OTelSpan( | |
| **s.model_dump( | |
| mode="json", | |
| exclude_none=True, | |
| exclude_unset=True, | |
| ) | |
| ) | |
| else: | |
| _spans[span.span_id] = OTelSpan( | |
| **span.model_dump( | |
| mode="json", | |
| exclude_none=True, | |
| exclude_unset=True, | |
| ) | |
| ) |
Was this helpful? React with 👍 or 👎 to provide feedback.
PR: Loadables Retrieval Alignment
Summary
This PR aligns loadables retrieval behavior across testsets/queries, removes stale design drift in docs, and makes the traces router a first-class traces API (no tracing-shaped response types in traces endpoints).
Change Inventory
API: Testsets
_populate_testcases(...)call-site argument binding bugs by switching to keyword arguments.order,next,limit) when enumeratingtestcase_ids.include_testcases=truereturns bothtestcasesandtestcase_ids./preview/testsets/revisions/retrievecaching policy to cache only wheninclude_testcases=false.API: Queries
next,limit) into stored windowing.tracesandtrace_ids./preview/queries/revisions/retrievecaching policy to cache only when bothinclude_trace_ids=falseandinclude_traces=false.API: Traces Router
TraceResponseTracesResponseTracesQueryRequestformattingfromTracesQueryRequest./preview/traces/queryto always return Agenta trace trees (never spans/opentelemetry formatting).TracingQueryrequest contract fromTracesRouter.query_traces; traces endpoint now consumes onlyTracesQueryRequest.query_ref,query_variant_ref,query_revision_ref).GET /preview/traces/{trace_id}) returningTraceResponse.Docs
docs/designs/loadables/loadables.querying.strategies.mdto include:windowing.nextterminologydocs/designs/loadables/loadables.initial.specs.mdexamples fromcursortonext.docs/designs/loadables/loadables.querying.gap-analysis.mdafter consolidating its useful content into the strategies document.Behavior Summary
/preview/testcases,/preview/traces) remain record-returning endpoints without extra top-level ID arrays.Validation
cd api && ruff format && ruff check --fixpytest -q oss/tests/pytest/e2e/tracing/test_traces_basics.py oss/tests/pytest/e2e/loadables/test_loadable_strategies.py27 passedpytest -q oss/tests/pytest/e2e/testsets/test_testsets_basics.py oss/tests/pytest/e2e/testsets/test_testsets_queries.py oss/tests/pytest/e2e/testsets/test_testcases_basics.py oss/tests/pytest/e2e/tracing/test_spans_basics.py oss/tests/pytest/e2e/tracing/test_spans_queries.py17 passed, 3 skipped(existing flaky skips)pytest -q oss/tests/pytest/e2e175 passed, 3 skipped