ref(seer): Refactor explorer service map query and instrumentation#109322
Merged
shruthilayaj merged 3 commits intomasterfrom Feb 25, 2026
Merged
ref(seer): Refactor explorer service map query and instrumentation#109322shruthilayaj merged 3 commits intomasterfrom
shruthilayaj merged 3 commits intomasterfrom
Conversation
Remove pagination loops from the broad and fallback scans in favour of single queries capped at min(_SNUBA_MAX_ROWS, max_segments). Bump _SNUBA_MAX_ROWS from 100 to 10000 so a single query covers realistic org sizes. Restore batching in the parent-resolution step at a fixed 1000 spans per batch to keep query strings within reasonable size limits. Send edges alongside nodes in the Seer payload so the downstream service has the full graph structure. Add sentry_sdk span instrumentation around each query phase (broad_scan, fallback_scan, resolve_parents) with per-span data for limit, rows_returned, covered_projects, unique_parent_spans, batch_count, and edges_found. Co-Authored-By: Claude <noreply@anthropic.com>
Renames the module and test file and updates all import paths and mock patch strings. Celery task broker names (name= in @instrumented_task) are intentionally unchanged to preserve backward compatibility with already-queued tasks. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Mihir-Mavalankar
approved these changes
Feb 25, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Refactors the service map dependency extraction in the Explorer Seer pipeline across three areas.
Query simplification: Removes pagination loops from the broad and fallback scans. Each is now a single query capped at
min(_SNUBA_MAX_ROWS, max_segments)._SNUBA_MAX_ROWSis bumped from 100 to 10000, which makes the single-query approach viable for realistic org sizes without needing multiple round trips.Parent resolution batching: The parent span resolution step retains batching but at a fixed 1000 spans per batch (previously used
_SNUBA_MAX_ROWS = 100). This bounds query string size — at 10k parent spans that would have been a ~250 KB OR clause in a single request.Edges in Seer payload:
_send_to_seernow sendsedgesalongsidenodesso the downstream service has the full graph structure rather than just the derived node metadata.Span instrumentation: Added
sentry_sdkspans around each query phase with relevant data attached:explorer.service_map.broad_scan:limit,rows_returned,covered_projectsexplorer.service_map.fallback_scan:uncovered_projects,limit,rows_returned(only created when there are actually uncovered projects)explorer.service_map.resolve_parents:unique_parent_spans,batch_count,edges_found