@@ -485,8 +485,10 @@ def _is_on_demand_supported_search_filter(token: QueryToken) -> bool:
485
485
if not _SEARCH_TO_RELAY_OPERATORS .get (token .operator ):
486
486
return False
487
487
488
- return not _is_excluding_transactions (token ) and _is_on_demand_supported_field (
489
- token .key .name
488
+ return (
489
+ not _is_excluding_transactions (token )
490
+ and not _is_error_field (token .key .name )
491
+ and _is_on_demand_supported_field (token .key .name )
490
492
)
491
493
492
494
if isinstance (token , ParenExpression ):
@@ -496,11 +498,13 @@ def _is_on_demand_supported_search_filter(token: QueryToken) -> bool:
496
498
497
499
498
500
def _is_excluding_transactions (token : SearchFilter ) -> bool :
499
- return (
500
- token .key .name == "event.type"
501
- and token .operator == "!="
502
- and token .value .raw_value == "transaction"
503
- )
501
+ if token .key .name != "event.type" :
502
+ return False
503
+
504
+ is_not_transaction = token .operator == "!=" and token .value .raw_value == "transaction"
505
+ is_error_or_default = token .operator == "=" and token .value .raw_value in ["error" , "default" ]
506
+
507
+ return is_not_transaction or is_error_or_default
504
508
505
509
506
510
def _is_standard_metrics_field (field : str ) -> bool :
@@ -512,6 +516,10 @@ def _is_standard_metrics_field(field: str) -> bool:
512
516
)
513
517
514
518
519
+ def _is_error_field (token : str ) -> bool :
520
+ return token .startswith ("error." )
521
+
522
+
515
523
def _is_standard_metrics_search_term (field : str ) -> bool :
516
524
return field in _STANDARD_METRIC_FIELDS
517
525
0 commit comments