feat(configuration-issues): Making processing_errors queryable#109884
feat(configuration-issues): Making processing_errors queryable#109884
Conversation
Backend Test FailuresFailures on
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Parameter
additional_queriessilently dropped in table queryProcessingErrors.run_table_querynow forwardsadditional_queriesintorpc_dataset_common.TableQuery, so caller-provided additional filters are no longer dropped.
Or push these changes by commenting:
@cursor push b11c4835be
Preview (b11c4835be)
diff --git a/src/sentry/snuba/processing_errors_rpc.py b/src/sentry/snuba/processing_errors_rpc.py
--- a/src/sentry/snuba/processing_errors_rpc.py
+++ b/src/sentry/snuba/processing_errors_rpc.py
@@ -46,6 +46,7 @@
sampling_mode=sampling_mode,
resolver=search_resolver or cls.get_resolver(params, config),
page_token=page_token,
+ additional_queries=additional_queries,
),
params.debug,
)| page_token=page_token, | ||
| ), | ||
| params.debug, | ||
| ) |
There was a problem hiding this comment.
Parameter additional_queries silently dropped in table query
Low Severity
ProcessingErrors.run_table_query accepts additional_queries as a parameter but never passes it to the TableQuery constructor. This means any cross-trace query filters provided by callers are silently ignored. The majority of other RPC datasets (Spans, OurLogs, TraceMetrics, PreprodSize) forward additional_queries to the TableQuery. While cross-trace queries may not be needed for processing errors today, silently dropping a caller-provided parameter can lead to confusing behavior if it's ever relied upon.
| selected_columns=selected_columns, | ||
| equations=equations, | ||
| orderby=orderby, | ||
| offset=offset, | ||
| limit=limit, | ||
| referrer=referrer, | ||
| sampling_mode=sampling_mode, | ||
| resolver=search_resolver or cls.get_resolver(params, config), | ||
| page_token=page_token, | ||
| ), | ||
| params.debug, |
There was a problem hiding this comment.
Bug: The run_table_query method for ProcessingErrors accepts additional_queries but fails to pass it to the TableQuery constructor, causing cross-trace filters to be silently ignored.
Severity: MEDIUM
Suggested Fix
In the run_table_query method, pass the additional_queries parameter to the TableQuery constructor. The call should be updated to include additional_queries=additional_queries to ensure cross-trace filters are applied correctly.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/sentry/snuba/processing_errors_rpc.py#L37-L50
Potential issue: In `src/sentry/snuba/processing_errors_rpc.py`, the `run_table_query`
method accepts an `additional_queries` parameter but does not pass it to the
`TableQuery` constructor. This parameter is used to apply cross-trace filters from API
parameters like `spanQuery` or `logQuery`. Because it is omitted, any such filters
provided by a user for the ProcessingErrors dataset are silently ignored. This results
in the query returning unfiltered data, which is incorrect and does not match the user's
request. Other datasets correctly pass this parameter, indicating this is an omission.
Did we get this right? 👍 / 👎 to inform future reviews.



Summary
Registers
processing_errorsas a queryable EAP dataset so the events and events-stats APIs can query processing error data (e.g. for issue details charts). Used established patterns for other queryable datasets as a guide.search/eap/processing_errors/module with column, attribute and aggregate function definitionsProcessingErrorsRPC dataset class insnuba/processing_errors_rpc.pysupporting table, timeseries, and top-events queriestypes.py,constants.py,utils.pyand enables it in theorganization_eventsandorganization_events_statsendpoints (including top-events support)ProcessingErrorTestCasemixin with helpers to create and store processing error itemsTest Plan
tests/sentry/search/eap/test_processing_errors.py— validates query parsing (filters, negation, in-filter, AND/OR, empty)tests/snuba/api/endpoints/test_organization_events_stats_processing_errors.py— validates count, zerofill, top events grouped byerror_type, filtering, and empty top events