@@ -1767,32 +1767,12 @@ def get(self, request: Request, organization: Organization, trace_id: str) -> Ht
1767
1767
query = f"trace:{ trace_id } " ,
1768
1768
limit = 1 ,
1769
1769
)
1770
- transaction_children_query = SpansIndexedQueryBuilder (
1771
- dataset = Dataset .SpansIndexed ,
1772
- selected_columns = [
1773
- "transaction.id" ,
1774
- "count()" ,
1775
- ],
1776
- orderby = ["transaction.id" ],
1777
- params = {},
1778
- snuba_params = snuba_params ,
1779
- query = f"trace:{ trace_id } " ,
1780
- limit = 10_000 ,
1781
- )
1782
1770
1783
1771
with handle_query_errors ():
1784
- results = bulk_snuba_queries (
1785
- [
1786
- meta_query .get_snql_query (),
1787
- transaction_children_query .get_snql_query (),
1788
- ],
1772
+ meta_result = meta_query .run_query (
1789
1773
referrer = Referrer .API_TRACE_VIEW_GET_META .value ,
1790
1774
query_source = query_source ,
1791
1775
)
1792
- meta_result , children_result = (
1793
- results [0 ],
1794
- results [1 ],
1795
- )
1796
1776
if len (meta_result ["data" ]) == 0 :
1797
1777
return Response (status = 404 )
1798
1778
# Merge the result back into the first query
@@ -1804,22 +1784,20 @@ def get(self, request: Request, organization: Organization, trace_id: str) -> Ht
1804
1784
return Response (
1805
1785
self .serialize (
1806
1786
meta_result ["data" ][0 ],
1807
- children_result ["data" ],
1808
1787
)
1809
1788
)
1810
1789
1811
1790
def serialize (
1812
1791
self ,
1813
1792
results : Mapping [str , int ],
1814
- child_result : Any ,
1815
- ) -> Mapping [str , int | dict [str , int ]]:
1793
+ ) -> Mapping [str , int | dict [str , int ] | list [Any ]]:
1816
1794
return {
1817
1795
# Values can be null if there's no result
1818
1796
"projects" : results .get ("projects" ) or 0 ,
1819
1797
"transactions" : results .get ("transactions" ) or 0 ,
1820
1798
"errors" : results .get ("errors" ) or 0 ,
1821
1799
"performance_issues" : results .get ("performance_issues" ) or 0 ,
1822
1800
"span_count" : 0 ,
1823
- "transaction_child_count_map" : child_result ,
1801
+ "transaction_child_count_map" : [] ,
1824
1802
"span_count_map" : {},
1825
1803
}
0 commit comments