Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: remove returnSpansFrom from rawexport e2e (#11278)

Piyush Singariyaf1ce80462930
diff --git a/tests/fixtures/querier.py b/tests/fixtures/querier.py
index 3415a4a8f7..8866ce0e47 100644
--- a/tests/fixtures/querier.py
+++ b/tests/fixtures/querier.py
@@ -69,7 +69,7 @@ class BuilderQuery:
class TraceOperatorQuery:
name: str
expression: str
- return_spans_from: str
+ return_spans_from: str | None = None
limit: int | None = None
order: list[OrderBy] | None = None
@@ -77,8 +77,9 @@ class TraceOperatorQuery:
spec: dict[str, Any] = {
"name": self.name,
"expression": self.expression,
- "returnSpansFrom": self.return_spans_from,
}
+ if self.return_spans_from is not None:
+ spec["returnSpansFrom"] = self.return_spans_from
if self.limit is not None:
spec["limit"] = self.limit
if self.order:
diff --git a/tests/integration/tests/rawexportdata/02_traces.py b/tests/integration/tests/rawexportdata/02_traces.py
index c6dbb8e677..d032ede6bc 100644
--- a/tests/integration/tests/rawexportdata/02_traces.py
+++ b/tests/integration/tests/rawexportdata/02_traces.py
@@ -625,7 +625,6 @@ def test_export_traces_with_composite_query_trace_operator(
query_c = TraceOperatorQuery(
name="C",
expression="A => B",
- return_spans_from="A",
limit=1000,
order=[OrderBy(TelemetryFieldKey("timestamp", "string", "span"), "desc")],
)
@@ -652,17 +651,15 @@ def test_export_traces_with_composite_query_trace_operator(
# Parse JSONL content
jsonl_lines = response.text.strip().split("\n")
- assert len(jsonl_lines) == 1, f"Expected at least 1 line, got {len(jsonl_lines)}"
+ assert len(jsonl_lines) >= 1, f"Expected at least 1 line, got {len(jsonl_lines)}"
- # Verify all returned spans belong to the matched trace
+ # Verify all returned spans belong to the matched trace.
+ # The direct-descendant JOIN emits one row per matching child, so the parent
+ # span may appear more than once (once per child that satisfies the condition).
json_objects = [json.loads(line) for line in jsonl_lines]
trace_ids = [obj.get("trace_id") for obj in json_objects]
assert all(tid == parent_trace_id for tid in trace_ids)
- # Verify the parent span (returnSpansFrom = "A") is present
- span_names = [obj.get("name") for obj in json_objects]
- assert "parent-operation" in span_names
-
def test_export_traces_with_select_fields(
signoz: types.SigNoz,