feat(explore): Accept crossEvents param on saved queries#113286
Open
nsdeschenes wants to merge 6 commits intomasterfrom
Open
feat(explore): Accept crossEvents param on saved queries#113286nsdeschenes wants to merge 6 commits intomasterfrom
nsdeschenes wants to merge 6 commits intomasterfrom
Conversation
Add an optional top-level crossEvents array to the Explore saved queries
POST/PUT serializer, and echo it back in GET responses. Each entry is a
{query, type} pair where type is limited to spans or logs.
Server-side validation enforces a max of 2 entries, the type whitelist,
and a 7-day range cap when crossEvents is present (matching the frontend
MAX_CROSS_EVENT_QUERIES and MAX_PERIOD_FOR_CROSS_EVENTS constants). The
field lives inside the existing query JSONField, so no model or
migration changes are required.
Refs EXP-667
Add happy-path, absence, over-limit, invalid-type, and >7d-range cases to the POST endpoint tests. Refs EXP-667
Add cases for adding, clearing, and rejecting invalid crossEvents on the detail endpoint PUT handler. Refs EXP-667
sync_prebuilt_queries instantiates ExploreSavedQuerySerializer with a context that only contains project_id, so a prebuilt query with crossEvents would raise KeyError when the validator dereferenced params[\"start\"] / params[\"end\"]. Only run the 7-day range check when both are present; the endpoint path still passes them via get_filter_params. Co-Authored-By: Claude <noreply@anthropic.com>
manessaraj
reviewed
Apr 17, 2026
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to enable users to save their cross-event queries, so they can easily view them over time.
When accepting an optional cross-event query, we also want to ensure that we follow the same limitations we have set on the FE. This means we limit them to two cross event queries either for
spansorlogs, as well as limiting the period selection window to seven days.As well, this PR includes
POSTandPUTrequest tests for the initial saving of a query, and updating of a query that contains cross event queries.Closes EXP-667