feat(preprod): Record client attribution on snapshot read endpoints#118387
Merged
mtopo27 merged 1 commit intoJun 24, 2026
Conversation
The three snapshot read endpoints now record an analytics `client` field that classifies each caller as web, sentry-cli, or MCP (with client family, e.g. `mcp:cursor`), so we can see how much snapshot read traffic comes from the MCP server and which client family versus the web UI. The existing get_snapshot_details event gains a `client` field, and the image and latest-base endpoints — which had no analytics — each emit a new event on the authorized-read path. Classification reuses resolve_action_source() rather than introducing a new helper; the issue.viewed call site is left unchanged. Refs EME-1215 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
NicoHinderling
approved these changes
Jun 24, 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 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 three snapshot read endpoints now record an analytics
clientfield thatclassifies each caller as web, sentry-cli, or MCP (with client family, e.g.
mcp:cursor). This lets us see in analytics how much snapshot read trafficcomes from the MCP server and which client family, versus the web UI — the same
attribution
issue.viewedalready records.get_snapshot(.../snapshots/{id}/) — existingpreprod_artifact.api.get_snapshot_detailsevent gains aclientfield.get_snapshot_image(.../snapshots/{id}/images/{image}/) andget_latest_base_snapshot(.../snapshots/latest-base/) had no analytics;each now emits a new event recorded on the authorized-read path.
Classification reuses the existing
resolve_action_source()(
sentry/issues/action_log), so the values match its scheme(
web/sentry-cli/mcp:<family>/api) rather thanissue.viewed'smcp - <family>format. No new helper, no change to the existingissue.viewedcall site.New/changed event payloads:
preprod_artifact.api.get_snapshot_detailsclientpreprod_artifact.api.get_snapshot_image(new)image_identifier,clientpreprod_artifact.api.get_latest_base_snapshot(new)app_id,clientScope note: this covers the MCP-tool read endpoints only. sentry-cli download
attribution is intentionally out of scope — the CLI hits a
.../snapshots/{id}/download/route that does not exist in sentry or getsentrytoday, so it needs that route built/aliased before it can be instrumented.
latest-basetraffic from the CLI is already captured here (classified assentry-cli) once the CLI uses it.Refs EME-1215